Does anyone know if there are any applications can support exporting Shapefile to GeoJSON and keeping the style?
-
5Shapefiles do not store styles either. Your software saves them in some other way which may be possible to transform or not. What software do you use and how do you plan to use the GeoJSON data?– user30184Commented Aug 15, 2018 at 5:55
-
There is a simple style spec for geojson called simpleStyle. github.com/mapbox/simplestyle-spec/tree/master/1.1.0 . I believe the question is regard to it.– doodersonCommented Oct 5, 2022 at 20:57
Add a comment
|
1 Answer
GeoJSONs do not store style, just feature geometry and attribute data. The only way you could save the style is if you were to embed the style properties as an attribute, for instance creating an attribute called colour
and populating it with what colour each feature should be.
Incidently, shapefiles do not store style, either. The style is applied by whatever application is loading the data.
-
1Or rather there is no standardized way for storing the styles. You can for example store styles as strings into an OGR_STYLE field according to gdal.org/ogr_feature_style.html and some software that utilize GDAL may be able to use the attribute for styling. Mapserver can but I do not know other examples. Commented Aug 15, 2018 at 9:38