[mapserver-users] MapServer + Database + WFS

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Thu Jul 31 00:19:55 PDT 2008


Hi,

I have successfully created WFS layers from Oracle 9i database.  I have not used that service very much, though, because for some reason ready made GIS clients had troubles in parsing the returned gml and I started to use GeoServer for WFS instead. I believe the trouble was not anything great, because ogr2ogr was happily translating the gml files to other vector formats if I stored them on disk first.

I think there are three things in your DATA line which may go wrong.  They may be OK as well, but perhaps you may have a look on them anyway.  First is in this SELECT:
"geom FROM (SELECT swt.switch_id, swt.switch_descr, sgt.geom

I would try in like 
"new_geom FROM (SELECT swt.switch_id, swt.switch_descr, sgt.geom AS new_geom

Just to be sure that a correct item will be queried by the final query.
Another thing is SRID  "USING SRID 8307"

I do not know if Oracle for sure nowadays understands automatically that this is jsut the epsg code it should be using.  I would make a try by importing a simple dataset into Oracle with shp2sdo or something.  First import by leaving the SRID as empty, and second be giving the correct epsg code.  Then I would make two new layers in mapfile and start playing with WFS queries.
Perhaps you can even just cut out the "USING SRID 8307" from your current mapfile. I suppose the data is actually in epsg:8307 in Oracle and you do not need to reproject it when running queries?
By the way, you seem not to have projections set for your layers.  It is not necessary if you are working with one projection only, but you will have much better control on what will really happen if you set projections for all the layers and for the whole mapfile.

Finally, your DATA is missing "using unique". I am not sure if it is necessary, though.

-Jukka Rahkonen-



-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: Nolte, Tim
Lähetetty: ke 30.7.2008 18:59
Vastaanottaja: Yewondwossen Assefa
Kopio: mapserver-users at lists.osgeo.org
Aihe: RE: [mapserver-users] MapServer + Database + WFS
 
So the specific issue I'm having is that my Oracle Spatial layers are
not coming back with any features. Here's a couple of my Mapfile
entries:

  LAYER
    GROUP switchboundaries
    NAME davenport
    TYPE POLYGON
    STATUS ON
    CONNECTIONTYPE oraclespatial  
    CONNECTION ".../... at ..."
    PROCESSING "CLOSE_CONNECTION=DEFER"
    DATA "geom FROM (SELECT swt.switch_id, swt.switch_descr, sgt.geom
FROM ms_switch_vw swt, switch_geom_tab sgt WHERE swt.switch_id =
sgt.switch_id AND swt.switch_id = 7) USING SRID 8307"
    LABELITEM "switch_descr"
    METADATA
      wfs_title "Switch Boundaries: Davenport"
      wfs_latlonboundingbox "-104.29 29.71 -71.55 52.63"
      wfs_typename "davenport"
      gml_featureid "switch_id"
      gml_include_items "switch_id,switch_descr"
      gml_switch_descr_alias "Switch"
    END
    DUMP TRUE
    TRANSPARENCY 100
  END

  LAYER
    GROUP cellsites
    NAME onair
    TYPE POINT
    STATUS ON
    CONNECTIONTYPE oraclespatial  
    CONNECTION ".../... at ..."
    PROCESSING "CLOSE_CONNECTION=DEFER"
    DATA "geom FROM (SELECT st.site_id, st.bts_nbr, sgt.geom FROM
site_tab st, site_geom_tab sgt WHERE st.site_id = sgt.site_id AND
st.site_status_id IN (4,7)) USING SRID 8307"
    LABELITEM "bts_nbr"
    METADATA
      wfs_title "Cell Sites: On-Air"
      wfs_latlonboundingbox "-104.29 29.71 -71.55 52.63"
      wfs_typename "onair"
      gml_geometries "geom"
	  gml_boundary_type "point"
      gml_featureid "site_id"
      gml_include_items "site_id,bts_nbr"
      gml_bts_nbr_alias "BTS#"
    END
    DUMP TRUE
  END


Any help would be greastly appreciated.

----
Timothy J Nolte - tnolte at ilpcs.com
Network Planning Engineer

iPCS Wireless, Inc.
4717 Broadmoor Ave, Suite G
Kentwood, MI 49512

Office: 616-656-5163
PCS:    616-706-2438
Fax:    616-554-6484
Web: www.ipcswirelessinc.com 

> -----Original Message-----
> From: Yewondwossen Assefa [mailto:yassefa at dmsolutions.ca] 
> Sent: Wednesday, July 30, 2008 11:38 AM
> To: Nolte, Tim
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] MapServer + Database + WFS
> 
> Tim,
> 
>   I have used mainly Postgis with Mapserver and WFS. I am pretty sure 
> some have used SDE as a back end.  Oracle spatial is also 
> known to work 
> with Mapserver for a while so I see no reason why it could 
> not be used 
> as a WFS server too.
>   Are you facing particular problems? Are you concerned about 
> performance issues? As for the documentation, I am assuming 
> that you are 
> taking about 
> http://mapserver.gis.umn.edu/docs/howto/wfs_server, It has 
> been a while that It has been updated but information in it is still 
> correct. Maybe specific issues/comment could help improving it.
> 
> best Regards,
> 
> Nolte, Tim wrote:
> > Is no one out there using Oracle Spatial, or any other DB, with
> > MapServer and WFS? There is pretty much a huge lack of 
> documentation for
> > serving WFS from MapServer. It would be nice to know if what I'm
> > attempting is even possible or not. Thanks if someone does actually
> > respond.
> > 
> > - Tim
> > 
> > ----
> > Timothy J Nolte - tnolte at ilpcs.com
> > Network Planning Engineer
> > 
> > iPCS Wireless, Inc.
> > 4717 Broadmoor Ave, Suite G
> > Kentwood, MI 49512
> > 
> > Office: 616-656-5163
> > PCS:    616-706-2438
> > Fax:    616-554-6484
> > Web: www.ipcswirelessinc.com
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > 
> 
> 
> -- 
> ----------------------------------------------------------------
> Assefa Yewondwossen
> Software Analyst
> 
> Email: assefa at dmsolutions.ca
> http://www.dmsolutions.ca/
> 
> Phone: (613) 565-5056 (ext 14)
> Fax:   (613) 565-0925
> ----------------------------------------------------------------
> 
> 
> 
_______________________________________________
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