Open tordans opened 6 years ago
i agree. there is serious room for improvement in our current validation.
right now we:
http://
or https://
. if not, we abort and display nothing./MapServer/
or /FeatureServer/
to make sure its a geoservice.we aren't validating the feature JSON at all. To make things a little more complicated, the query operation of modern geoservices is capable of emitting native GeoJSON (which include properties
), while older geoservices only emit Esri flavored feature JSON (which include attributes
).
side by side comparison: https://gist.github.com/jgravois/eab035258f8157d54618
currently we first fetch only metadata from the service to see whether it supports asking for native GeoJSON. If it doesn't we ask for Esri/Geoservice feature JSON and convert it into GeoJSON for iD
client-side.
what you're trying to do is just store valid GeoJSON in a flat file on a server. a bit of refactoring of our code would necessary to short circuit the series of API calls we currently make once we are convinced the user has supplied a geoservice url.
right now we:
a) ask for metadata to determine whether or not support for f=geojson
is present
b) first, fetch only a count of the features within the supplied bounding box
c) then fetch a count of the total number of features stored behind the entire service
d) lastly, fetch only the features within the supplied bounding box (using f=json
only if support for f=geojson
isn't present).
I am still trying to use the importer with https://github.com/mapmeld/iD/issues/66.
ATM my problem is either the url format or the json format. Unfortunatelly the importer is not very helpful in understanding and solving the error.
Ideally, the importer would talk to me about:
URL
JSON
Testcases
attributes
, minimalproperties
, minimalproperties
, with contentattributes
, with contentUse
properties
orattributes
?The example URL from https://github.com/mapmeld/iD/issues/66#issuecomment-377297076 @jgravois uses a
properties
. The http://geoservices.github.io/ example, that was referenced before, usesattributes
.Other usability improvements
Use case: I input an url -> see an error message -> change the URL -> see the same error message. ATM it is not clear if the "second" error message is still the same as before or if the new URL still creates an (new) error.