Closed nuest closed 10 years ago
Interesting how the GeoJSON source has nested properties, not sure how ogr2ogr would handle that since Shapefiles are a flat tabular structure (DBF). Taking a peek and will let you know if I come up with anything.
Ahh yes. Since the phenomenon field is a nested structure in the JSON, ogr2ogr just flattens that out into a single column with JSON data. I don't see any options to change that behavior: http://www.gdal.org/ogr/drv_geojson.html
Right - thanks for checking! I'm not an expert in ogr2ogr :-). We'll take a look into the problem on our end (https://github.com/enviroCar/enviroCar-server/issues/144) and see if we can change the JSON structure or if we have to implement the conversion ourselves.
Thanks for your help!
OK sounds good, maybe a process that flattens those field names? e.g.
"phenomenons-Speed-value": 41, "phenomenons-Speed-unit": "km/h"
If its a common enough thing I would consider adding it to Ogre.
I just now found out we already have a webservice that does a conversion to shapefile (and probably manually maps the attributes), so sorry for taking your time - I'll keep this project in mind though, you never know.
I'll also bring up the topic of your attribute datamodel - seems like we're not following the usual practices here...
I successfully converted a JSON track (e.g. https://envirocar.org/api/stable/tracks/52714d4ee4b000fe0582a292) from enviroCar with your great website!
However, all the observed properties are in one column when I open the shapefile in QGis. Is this an issue with the GeoJSON file that is put in, or a problem of the conversion?
Input JSON snippet
Thanks for your help!