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

going from geometry points to geometry polygons #20

Closed
creinemann opened this issue Jul 23, 2021 · 1 comment
Closed

going from geometry points to geometry polygons #20

creinemann opened this issue Jul 23, 2021 · 1 comment

Comments

@creinemann
Copy link

Help needed

I am trying to convert a shape file to a geojson file using this command:

Which works.
But I need to convert the "type" points

From this:
{ "type": "FeatureCollection", "name": "MODIS_C6_1_Global_24h", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "LATITUDE": -19.181, "LONGITUDE": 146.603, "BRIGHTNESS": 311.9, "SCAN": 2.4, "TRACK": 1.5, "ACQ_DATE": "2021-07-22", "ACQ_TIME": "0000", "SATELLITE": "T", "CONFIDENCE": 61, "VERSION": "6.1NRT", "BRIGHT_T31": 295.2, "FRP": 28.4, "DAYNIGHT": "D" }, "geometry": { "type": "Point", "coordinates": [ 146.603, -19.181 ] } },

To This:
{ "type": "FeatureCollection", "name": "fire", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "LATITUDE": -19.181, "LONGITUDE": 146.603, "BRIGHTNESS": 311.9, "SCAN": 2.4, "TRACK": 1.5, "ACQ_DATE": "2021-07-22", "ACQ_TIME": "0000", "SATELLITE": "T", "CONFIDENCE": 61, "VERSION": "6.1NRT", "BRIGHT_T31": 295.2, "FRP": 28.4, "DAYNIGHT": "D" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 146.613, -19.181 ], [ 146.61251056516295, -19.184090169943751 ], [ 146.611090169943765, -19.186877852522926 ], [ 146.608877852522937, -19.18909016994375 ], [ 146.606090169943769, -19.190510565162953 ], [ 146.603, -19.191 ], [ 146.599909830056248, -19.190510565162953 ], [ 146.59712214747708, -19.18909016994375 ], [ 146.594909830056253, -19.186877852522926 ], [ 146.593489434837068, -19.184090169943751 ], [ 146.593, -19.181 ], [ 146.593489434837068, -19.177909830056251 ], [ 146.594909830056253, -19.175122147477076 ], [ 146.59712214747708, -19.172909830056252 ], [ 146.599909830056248, -19.171489434837049 ], [ 146.603, -19.171 ], [ 146.606090169943769, -19.171489434837049 ], [ 146.608877852522937, -19.172909830056252 ], [ 146.611090169943765, -19.175122147477076 ], [ 146.61251056516295, -19.177909830056251 ], [ 146.613, -19.181 ] ] ] ] } },

I had used QGIS to do this by using the buffer command to create a polygon instead of a point

Is this something I could do from a command line wih ogr2ogr.

@creinemann
Copy link
Author

this is the solution

ogr2ogr -f "GeoJSON" -dialect SQLite -sql "select ST_Buffer(geometry,
0.01) from inputfile" output.geojson inputfile.shp

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