[mapserver-users] MapServer SOS setup questions

Carsen Banister carsen.banister at gmail.com
Thu Nov 27 07:41:41 PST 2014


Hi Jeff,

Thanks for link [1], in the process of doing that.

In the meantime, is anybody able to provide input on the initial questions?:
>> 1.How do you connect different layers together? e.g. layer and sublayer.
>> What is the syntax for that in the mapfile?
>>
>> 2.Is there a way to dynamically generate layers (e.g. from database
>> query result), or does the layer structure have to be hardcoded?
>>
>> 3.When you do a GetObservation, how do you set up MapServer so that that
>> request pulls data from the database, e.g. OVF file configuration?

Best regards,
Carsen

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jeff McKenna
Sent: November 25, 2014 11:40 AM
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] MapServer SOS setup questions

Hi Carsen,

Great.  Can you also please list the exact errors that you get with the ovf
and mapfile?  (I recommend using the commandline utility shp2img for testing
the mapfile[1])

Then once you are able to generate a valid map image with shp2img, you
should move to debugging your SOS service.  You could then paste parts of
your GetCapabilities response, or the request that is causing you trouble
(and its response), here and the mailing list community can hopefully help
you along.

Regarding your comment on steep learning curve, well here is your chance to
help prevent that in the future: as you travel along the
MapServer/mysql/ovf/SOS path, contribute enhancements to the MapServer docs,
write your notes on the MapServer wiki.....contribute, help, and share! :)

Thanks!


[1] http://mapserver.org/utilities/shp2img.html

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/




On 2014-11-25 12:05 PM, Carsen Banister wrote:
> Hi Jeff,
>
> Thanks for the reply. Here is my OVF file, which is able to connect to the
> database and return information (via Linux command line):
>
> (sostest.ovf):
>
> <OGRVRTDataSource>
>      <OGRVRTLayer name="Stations">
> 	
>
<SrcDataSource>MYSQL:dbname,user=usr,password=pw,host=127.0.0.1,port=3306,ta
> bles=Stations</SrcDataSource>
> 	  <SrcSQL>SELECT StationId, Name FROM Stations</SrcSQL>
> 	  <Field name="StationName" type="string" src="Name" />
> 	  <Field name="StationId" type="string" src="StationId" />
>      </OGRVRTLayer>
>      <OGRVRTLayer name="InstrumentReadings">
> 	
>
<SrcDataSource>MYSQL:dbname,user=usr,password=pw,host=127.0.0.1,port=3306,ta
> bles=InstrumentReadings</SrcDataSource>
> 	  <SrcSQL>SELECT ReadingValue, ReadingTime FROM InstrumentReadings
> WHERE InstrumentId = 134 LIMIT 1000</SrcSQL>
> 	  <Field name="Value" type="String" src="ReadingValue"/>
> 	  <Field name="Time" type="DateTime" src="ReadingTime"/>
>      </OGRVRTLayer>
> </OGRVRTDataSource>
>
> Here is the map file I would like to link the data to (I've omitted some
> metadata entries with ...):
>
> (sostest.map):
>
> MAP
>    NAME "SOS_server"
>    STATUS ON
>    SIZE 300 300
>    EXTENT -66 44 -62 45
>    UNITS METERS
>    SHAPEPATH "./data/"
>    IMAGECOLOR 255 255 0
>
>    IMAGETYPE png
>
>    WEB
>      IMAGEPATH "/ms4w/tmp/ms_tmp/"
>      IMAGEURL "/ms_tmp/"
>
>      METADATA
> 	  ...
>      END
>    END
>
>    PROJECTION
>      "init=epsg:4326"
>    END
>
>    LAYER
>      NAME "OfferingStation_1"
>      METADATA
> 	  "sos_procedure" "OfferingStation_1"
> 	  "sos_offering_id" "OfferingStation_1"
> 	  "sos_offering_name" "OfferingStation_1"
> 	  "sos_observedproperty_id" "Temperature_1 "
> 	  "sos_offering_intendedapplication" "Application"
> 	  "sos_offering_timeextent" "2013-11-29T00:00:00Z/"
> 	  "sos_describesensor_url"
>
"http://trac.osgeo.org/mapserver/browser/trunk/msautotest/wxs/data/sos-%proc
> edure%.xml?format=raw"
>      END
>      STATUS DEFAULT
>      TYPE POINT
>      CONNECTIONTYPE OGR
>      CONNECTION "sostest.ovf"
>      DATA "Stations"
>
>      PROJECTION
> 	  "init=epsg:4326"
>      END
>    END
>
>    LAYER
>      NAME "OfferingStation_2"
>      METADATA
> 	  "sos_procedure" "OfferingStation_2"
> 	  "sos_offering_id" "OfferingStation_2"
> 	  "sos_offering_name" "OfferingStation_2"
> 	  "sos_observedproperty_id" "Temperature_2"
> 	  "sos_offering_intendedapplication" "Application"
> 	  "sos_offering_timeextent" "2013-11-29T00:00:00Z"
> 	  "sos_describesensor_url"
>
"http://trac.osgeo.org/mapserver/browser/trunk/msautotest/wxs/data/sos-%proc
> edure%.xml?format=raw"
>      END
>      STATUS DEFAULT
>      TYPE POINT
>      CONNECTIONTYPE OGR
>      CONNECTION "sostest.ovf"
>      DATA "Stations"
>
>      PROJECTION
> 	  "init=epsg:4326"
>      END
>    END
>
> END #map
>
> Regards,
> Carsen
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jeff McKenna
> Sent: November 25, 2014 8:21 AM
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] MapServer SOS setup questions
>
> Hi Carsen,
>
> Regarding .ovf configuration, MySQL connections are well documented, with
> examples[1].  Or, if you already have an ovf connection, maybe you should
> paste it into your message so that the whole mailing list community can
help
> you along.
>
> In terms of SOS servers, I am also aware of a very active project named
> istSOS, that you should take a look at[2].
>
> [1] http://mapserver.org/input/vector/mysql.html
> [2]
>
https://geoservice.ist.supsi.ch/projects/istsos/index.php/Welcome_to_istSOS_
> project
>
> -jeff
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
>
>
>
> On 2014-11-24 9:50 PM, Carsen Banister wrote:
>> Hi,
>>
>> I would appreciate any help on some items associated with setting up
>> MapServer SOS. I am quite new to MapServer, and am trying to get up to
>> speed as quickly as possible. The reason for using MapServer's SOS is
>> that the database structure is custom and I'm not aware of any other SOS
>> servers that support custom MySQL databases (if you can point me in a
>> direction easier than MapServer, please do!).
>>
>> So, the questions I am hoping to get clarification on are:
>>
>> 1.How do you connect different layers together? e.g. layer and sublayer.
>> What is the syntax for that in the mapfile?
>>
>> 2.Is there a way to dynamically generate layers (e.g. from database
>> query result), or does the layer structure have to be hardcoded?
>>
>> 3.When you do a GetObservation, how do you set up MapServer so that that
>> request pulls data from the database, e.g. OVF file configuration?
>>
>> Thanks in advance for any assistance.
>>
>> Best regards,
>>
>> Carsen
>>
>>
>

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list