[mapserver-users] OGR GeoJSON Layers...

James Klassen klassen.js at gmail.com
Fri Dec 7 08:50:36 PST 2018


The following works for me with MapServer 7.0.6/GDAL 2.2.  Note it doesn't
appear to pass the bbox filter to the ESRI service so this only works with
small layers (otherwise it will timeout).  With newer GDAL versions
'OGRGeoJSON' will likely need to become 'ESRIJSON'.


    LAYER
        NAME 'rcoffices'
        TYPE POINT

        CONNECTIONTYPE OGR
        CONNECTION "
https://maps.co.ramsey.mn.us/arcgis/rest/services/MapRamsey/MapRamseyOperationalLayersAll/MapServer/1/query?f=json&where=1=1&outFields=*&orderByFields=OBJECTID
"

        DATA "OGRGeoJSON"

        PROJECTION "init=epsg:200068" END

        CLASS
            STYLE
                SYMBOL "circle"
                SIZE 10
                COLOR 255 0 0
                OUTLINECOLOR 0 0 0
            END
        END
    END


Note: epsg:200068 is setup locally as Ramsey County Coordinates:

+proj=lcc +lat_2=44.88333333333333 +lat_1=45.13333333333333
+lat_0=44.79111111111111 +lon_0=-93.38333333333334 +x_0=152400.3048
+y_0=30480.0610 +unit=sft +to_meter=0.30480060960122 +a=6378418.941
+b=6357033.310 +no_defs

On Mon, Dec 3, 2018 at 3:13 PM Lime, Steve D (MNIT) <steve.lime at state.mn.us>
wrote:

> Hi all: I’m running into an issue with GeoJSON service URLs vs local
> GeoJSON files. If I setup a connection like so:
>
>
>
>   CONNECTIONTYPE OGR
>
>   CONNECTION “http://...some arcgis
> server.../arcgis/rest/services...?...query string…”
>
>
>
> and try to draw the layer it seems like it’s fetching features yet nothing
> is drawn. With CONFIG “CPL_DEBUG” “ON” I see an OGR message that it was
> able to open the URL successfully as GeoJSON . Using ogrinfo at the command
> line also works with the URL.
>
>
>
> If I first save the URL response using wget and reference the local file,
> e.g.:
>
>
>
>   CONNECTIONTYPE OGR
>
>   CONNECTION “foo.json”
>
>
>
> then the layer is drawn successfully. I know this has come up at least
> once before on the list but with no resolution.
>
>
>
> This is running MapServer 6.4.5.
>
>
>
> --Steve
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20181207/c02dc660/attachment.html>


More information about the mapserver-users mailing list