map file syntax for geojson file formats

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

map file syntax for geojson file formats

e.arapostathis

Hello,

 

  As few years have passed since the time that I was using mapserver constantly (before geojson file format started emerging) I would like to ask if there is any basic difference while creating the map files.

 

It would be of great help if you could provide me an example in the following map file which loads a shape file. What differences must be done in order to load the file cemetery.geojson instead of the cemetery.shp?

 

 

MAP

                INCLUDE '../../geomoose_globals.map'

 

                WEB

                                METADATA

                                                'ows_title' 'Cemeteries'

                                                INCLUDE '../../common_metadata.map'

            'wfs_getfeature_formatlist' 'gml,geojson'

                                END

                END

 

    DEBUG 5

 

 

                LAYER

                                NAME cemeteries

                                GROUP cemeteries

                                STATUS ON

 

                                METADATA

                                                'ows_title' 'cemeteries'

                                                'ows_include_items' 'all'

                                                'gml_include_items' 'all'

                                END

 

                                TYPE POINT

                                DATA './cemeteries.shp’

                                TOLERANCE 4

                                PROJECTION

                                                'init=epsg:4326'

                                END

 

                                CLASS

                                                STYLE

                                                                SYMBOL 'cemetery.png'

                                                                SIZE 13

                                                END

                                END

 

                                TEMPLATE 'dummy'

                END

 

END ## end Map

 

 

Thank you for your help.


Virus-free. www.avast.com

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: map file syntax for geojson file formats

Lime, Steve D (MNIT)

It’s actually GDAL/OGR that provides GeoJson read support. So assuming you have a file called cemeteries.geojson it should be as simple as replacing:

 

  DATA './cemeteries.shp’

 

with:

 

   CONNECTIONTYPE OGR

   CONNECTION ‘./cemeteries.geojson’

 

See https://mapserver.org/input/vector/ogr.html for additional information on OGR support.

 

--Steve

 

 

From: mapserver-users [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Friday, January 11, 2019 11:24 AM
To: [hidden email]
Subject: [mapserver-users] map file syntax for geojson file formats

 

Hello,

 

  As few years have passed since the time that I was using mapserver constantly (before geojson file format started emerging) I would like to ask if there is any basic difference while creating the map files.

 

It would be of great help if you could provide me an example in the following map file which loads a shape file. What differences must be done in order to load the file cemetery.geojson instead of the cemetery.shp?

 

 

MAP

                INCLUDE '../../geomoose_globals.map'

 

                WEB

                                METADATA

                                                'ows_title' 'Cemeteries'

                                                INCLUDE '../../common_metadata.map'

            'wfs_getfeature_formatlist' 'gml,geojson'

                                END

                END

 

    DEBUG 5

 

 

                LAYER

                                NAME cemeteries

                                GROUP cemeteries

                                STATUS ON

 

                                METADATA

                                                'ows_title' 'cemeteries'

                                                'ows_include_items' 'all'

                                                'gml_include_items' 'all'

                                END

 

                                TYPE POINT

                                DATA './cemeteries.shp’

                                TOLERANCE 4

                                PROJECTION

                                                'init=epsg:4326'

                                END

 

                                CLASS

                                                STYLE

                                                                SYMBOL 'cemetery.png'

                                                                SIZE 13

                                                END

                                END

 

                                TEMPLATE 'dummy'

                END

 

END ## end Map

 

 

Thank you for your help.

 

Virus-free. www.avast.com

 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: map file syntax for geojson file formats

e.arapostathis

Thank you very much for the quick and very clear and helpful responses.

Could I ask a last question please?

How could the same map file be transformed in order to create a WFS connection type?

 

Is it something like:

 

CONNECTIONTYPE WFS

DATA ‘./cemeteries.shp’     ?

 

 

From: Lime, Steve D (MNIT) <[hidden email]>
Sent: Friday, January 11, 2019 10:25 PM
To: [hidden email]; [hidden email]
Subject: RE: [mapserver-users] map file syntax for geojson file formats

 

It’s actually GDAL/OGR that provides GeoJson read support. So assuming you have a file called cemeteries.geojson it should be as simple as replacing:

 

  DATA './cemeteries.shp’

 

with:

 

   CONNECTIONTYPE OGR

   CONNECTION ‘./cemeteries.geojson’

 

See https://mapserver.org/input/vector/ogr.html for additional information on OGR support.

 

--Steve

 

 

From: mapserver-users [[hidden email]] On Behalf Of [hidden email]
Sent: Friday, January 11, 2019 11:24 AM
To: [hidden email]
Subject: [mapserver-users] map file syntax for geojson file formats

 

Hello,

 

  As few years have passed since the time that I was using mapserver constantly (before geojson file format started emerging) I would like to ask if there is any basic difference while creating the map files.

 

It would be of great help if you could provide me an example in the following map file which loads a shape file. What differences must be done in order to load the file cemetery.geojson instead of the cemetery.shp?

 

 

MAP

                INCLUDE '../../geomoose_globals.map'

 

                WEB

                                METADATA

                                                'ows_title' 'Cemeteries'

                                                INCLUDE '../../common_metadata.map'

            'wfs_getfeature_formatlist' 'gml,geojson'

                                END

                END

 

    DEBUG 5

 

 

                LAYER

                                NAME cemeteries

                                GROUP cemeteries

                                STATUS ON

 

                                METADATA

                                                'ows_title' 'cemeteries'

                                                'ows_include_items' 'all'

                                                'gml_include_items' 'all'

                                END

 

                                TYPE POINT

                                DATA './cemeteries.shp’

                                TOLERANCE 4

                                PROJECTION

                                                'init=epsg:4326'

                                END

 

                                CLASS

                                                STYLE

                                                                SYMBOL 'cemetery.png'

                                                                SIZE 13

                                                END

                                END

 

                                TEMPLATE 'dummy'

                END

 

END ## end Map

 

 

Thank you for your help.

 

Virus-free. www.avast.com

 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: map file syntax for geojson file formats

Lime, Steve D (MNIT)
Depends if you’re talking about connecting to a WFS service or using MapServer to create a WFS service.

See https://mapserver.org/input/vector/wfs.html for the former and https://mapserver.org/ogc/wfs_server.html for the latter... it’s a little more involved.

—Steve
From: [hidden email] <[hidden email]>
Sent: Saturday, January 12, 2019 10:06:40 AM
To: Lime, Steve D (MNIT); [hidden email]
Subject: RE: [mapserver-users] map file syntax for geojson file formats
 

Thank you very much for the quick and very clear and helpful responses.

Could I ask a last question please?

How could the same map file be transformed in order to create a WFS connection type?

 

Is it something like:

 

CONNECTIONTYPE WFS

DATA ‘./cemeteries.shp’     ?

 

 

From: Lime, Steve D (MNIT) <[hidden email]>
Sent: Friday, January 11, 2019 10:25 PM
To: [hidden email]; [hidden email]
Subject: RE: [mapserver-users] map file syntax for geojson file formats

 

It’s actually GDAL/OGR that provides GeoJson read support. So assuming you have a file called cemeteries.geojson it should be as simple as replacing:

 

  DATA './cemeteries.shp’

 

with:

 

   CONNECTIONTYPE OGR

   CONNECTION ‘./cemeteries.geojson’

 

See https://mapserver.org/input/vector/ogr.html for additional information on OGR support.

 

--Steve

 

 

From: mapserver-users [[hidden email]] On Behalf Of [hidden email]
Sent: Friday, January 11, 2019 11:24 AM
To: [hidden email]
Subject: [mapserver-users] map file syntax for geojson file formats

 

Hello,

 

  As few years have passed since the time that I was using mapserver constantly (before geojson file format started emerging) I would like to ask if there is any basic difference while creating the map files.

 

It would be of great help if you could provide me an example in the following map file which loads a shape file. What differences must be done in order to load the file cemetery.geojson instead of the cemetery.shp?

 

 

MAP

                INCLUDE '../../geomoose_globals.map'

 

                WEB

                                METADATA

                                                'ows_title' 'Cemeteries'

                                                INCLUDE '../../common_metadata.map'

            'wfs_getfeature_formatlist' 'gml,geojson'

                                END

                END

 

    DEBUG 5

 

 

                LAYER

                                NAME cemeteries

                                GROUP cemeteries

                                STATUS ON

 

                                METADATA

                                                'ows_title' 'cemeteries'

                                                'ows_include_items' 'all'

                                                'gml_include_items' 'all'

                                END

 

                                TYPE POINT

                                DATA './cemeteries.shp’

                                TOLERANCE 4

                                PROJECTION

                                                'init=epsg:4326'

                                END

 

                                CLASS

                                                STYLE

                                                                SYMBOL 'cemetery.png'

                                                                SIZE 13

                                                END

                                END

 

                                TEMPLATE 'dummy'

                END

 

END ## end Map

 

 

Thank you for your help.

 

Virus-free. www.avast.com

 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users