[mapserver-users] OGR GeoJSON

Jim Klassen klassen.js at gmail.com
Mon Dec 17 10:11:39 PST 2018


Currently, MapServer will treat the data projection/type/etc. however
you tell it to.  I think this is a useful feature for making things work
in cases where the source data isn't as perfect as we may all like.

Also, these ESRI rest services aren't GeoJSON (hence OGR renaming the
layer to ESRIJSON) and do support arbitrary projections.  They also
support things like true curves, etc.

These properties become important when you need to preserve topology,
such as with a parcel layer, and make strict GeoJSON useless in those
cases.  (Nearly every geospatial tool only re-projects the points
instead of properly converting edges to curves and/or adding points to
approximate a correct conversion and thus can severely misrepresent the
object depending on the old and new projections.)   The ability to
*internally* abuse the GeoJSON spec with other coordinate systems versus
inventing something entirely new, or dealing with the complexities of
GML can be helpful here.


On 12/10/18 4:00 AM, Passmore, James H. wrote:
> Not sure though if MapServer should be supporting any projection other than urn:ogc:def:crs:OGC::CRS84 as per the formal GeoJSON specification https://tools.ietf.org/html/rfc7946.
>
> James
>
> -----Original Message-----
> From: mapserver-users <mapserver-users-bounces at lists.osgeo.org> On Behalf Of mapserver-users-request at lists.osgeo.org
> Sent: 07 December 2018 20:00
> To: mapserver-users at lists.osgeo.org
> Subject: mapserver-users Digest, Vol 131, Issue 5
>
> Send mapserver-users mailing list submissions to
> mapserver-users at lists.osgeo.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> or, via email, send a message with subject or body 'help' to
> mapserver-users-request at lists.osgeo.org
>
> You can reach the person managing the list at
> mapserver-users-owner at lists.osgeo.org
>
> When replying, please edit your Subject line so it is more specific than "Re: Contents of mapserver-users digest..."
>
>
> Today's Topics:
>
>    1. Re: OGR GeoJSON Layers... (James Klassen)
>    2. Re: OGR GeoJSON Layers... (Lime, Steve D (MNIT))
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 7 Dec 2018 10:50:36 -0600
> From: James Klassen <klassen.js at gmail.com>
> To: "Lime, Steve D (MNIT)" <steve.lime at state.mn.us>
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] OGR GeoJSON Layers...
> Message-ID:
> <CAHqX7961CqiAUDOCGM1BRggf7W5SY8=AGnFBLKUw7pa7jnqK2Q at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 7 Dec 2018 17:33:39 +0000
> From: "Lime, Steve D (MNIT)" <steve.lime at state.mn.us>
> To: James Klassen <klassen.js at gmail.com>
> Cc: "mapserver-users at lists.osgeo.org"
> <mapserver-users at lists.osgeo.org>
> Subject: Re: [mapserver-users] OGR GeoJSON Layers...
> Message-ID:
> <SN6PR0901MB23175622C6BE1D28B652153EDAAA0 at SN6PR0901MB2317.namprd09.prod.outlook.com>
>
> Content-Type: text/plain; charset="windows-1252"
>
> It may be my GDAL version, it’s a tad older. I will try and update that. Might be worth thininking about supporting runtime subs in the OGR url to pass extent values easily - where MapServer does the substitution using computed values. Kinda like the bbox hack for PostGIS.
> ________________________________
> From: James Klassen <klassen.js at gmail.com>
> Sent: Friday, December 7, 2018 10:50:36 AM
> To: Lime, Steve D (MNIT)
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] OGR GeoJSON Layers...
>
> 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<mailto: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<mailto: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/da1f2267/attachment-0001.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
> ------------------------------
>
> End of mapserver-users Digest, Vol 131, Issue 5
> ***********************************************
>
>
> This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system.
> UK Research and Innovation has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UK Research and Innovation does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.
> Opinions, conclusions or other information in this message and attachments that are not related directly to UK Research and Innovation business are solely those of the author and do not represent the views of UK Research and Innovation.
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list