2

Does anyone know if there are any applications can support exporting Shapefile to GeoJSON and keeping the style?

2
  • 5
    Shapefiles 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?
    – user30184
    Commented 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.
    – dooderson
    Commented Oct 5, 2022 at 20:57

1 Answer 1

8

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.

1
  • 1
    Or 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.
    – user30184
    Commented Aug 15, 2018 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.