Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geojson from points #637

Open
chris3522 opened this issue Apr 17, 2024 · 2 comments
Open

geojson from points #637

chris3522 opened this issue Apr 17, 2024 · 2 comments

Comments

@chris3522
Copy link

Hello, is there a command line way to draw a single geojson that surrounds the lat lon points. Lines can join the outermost points for example but there may be cases (red zone) where this is difficult. The lat lon points are contained in a csv (cf file).
Many thanks

surround

BV_GRAND-PARIS__1__FRANXL1S100.csv

@chris3522
Copy link
Author

I try an intermediate solution by creating a bounding rectangle but I get an error with this command:

csvPoints = `./BV_GRAND-PARIS__1__FRANXL1S100.csv`
mapshaper.runCommandsXL(`-i ${csvPoints} -calc 'xmin=min(lon)' -calc 'ymin=min(lat)' -calc 'xmax=max(lon)' -calc 'ymax=max(lat)' -rectangle 'bbox=xmin,ymin,xmax,ymax'`)

because maphaper cannot find the variables xmin,ymin,xmax and ymax

@chris3522
Copy link
Author

Here the error:

Error: Command failed:/mapshaper/bin/mapshaper -i ./BV_GRAND-PARIS__1__FRANXL1S100.csv  -calc 'xmin=min(LON),ymin=min(LAT),xmax=max(LON),ymax=max(LAT)' -rectangle 'bbox=xmin,ymin,xmax,ymax'
Allocating 8 GB of heap memory
[i] Auto-detected number fields: INDEX, LON, LAT
[calc] xmin=min(LON),ymin=min(LAT),xmax=max(LON),ymax=max(LAT):  2.23
Error: [rectangle] Missing rectangle extent
Run mapshaper -h to view help

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:514:28)
    at Pipe.<anonymous> (node:net:337:12) {
  code: 1,
  killed: false,
  signal: null,
  cmd: "/nodejs/bin/node --max-old-space-size=8000 /mapshaper/bin/mapshaper -i ./BV_GRAND-PARIS__1__FRANXL1S100.csv  -calc 'xmin=min(LON),ymin=min(LAT),xmax=max(LON),ymax=max(LAT)' -rectangle 'bbox=xmin,ymin,xmax,ymax'"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant