jumpinjackie / mapguide-rest

REST Extension for MapGuide Open Source
GNU Lesser General Public License v2.1
26 stars 14 forks source link

Query features from feature source with spatial filter may produce long request #173

Open AlenKelemen opened 7 years ago

AlenKelemen commented 7 years ago

If I use complex spatial filter (like buffer polygon with large WKT) my request may become very long, for example: http://localhost/mapguide/rest/library/[someSource].FeatureSource/features.geojson/schema/class?filter=Geom INSIDE GeomFromText('POLYGON(( [here comes long WKT] ))'). Maybe we could improve this using POST instead GET ?

jumpinjackie commented 7 years ago

Yes, as un-restful as that may be, it's something that should be supported.

AlenKelemen commented 7 years ago

I solved this with:

 $.ajax({
 url: "http://" + location.hostname + "/mapguide/rest" + "/library/ppdVukovar/Data/imagisPlin.FeatureSource/features.geojson/plin/Ventil",
                        dataType: "text",
                        type: "POST",
                        data: "filter=Geom INSIDE GeomFromText('" + wktBuffer + "')",
                        headers: {
                            "X-HTTP-Method-Override": "GET"
                        },....