Opened 12 years ago
Last modified 12 years ago
#4314 closed enhancement
Add ability to detect geojson files without an extension — at Initial Version
Reported by: | springmeyer | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.0 |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
GeoJSON is becoming a very common format for data apis. And therefore it is common for applications to grab it remotely. OGR nicely supports reading geojson from a string via url or locally. But in some cases an application may wish to download the data locally, cache it, and then pass that data to ogr. In the common case that the url does not end in a well know geojson extension, simply saving the file without an extension and passing the filename to ogr fails.
It would be nice if ogr would handle detection better instead of requiring the calling application to open the file and detect if it is geojson just to give it a filename extension.
The attached patch is a first stab at that. Im totally unfamiliar with CPL usage and coding styles (eg. I free the char*
but should the CPLString
also be freed?), so please have mercy.