WFS problem solved - projection issue

nelson guda nelson.guda at GMAIL.COM
Mon Dec 31 07:17:12 PST 2007


WFS problem solved - projection issue:

I was having a problem with getting WFS to work correctly on  
mapserver.  The mapserver WFS was functioning properly (returning the  
correct info from a GetCapabilities request.  However the map did not  
function properly.  Tom Kralidis helped me solve the problem by  
identifying that I had more than one projection definition in the WFS  
mapfile - WFS mapfiles will not function with more than one level of  
projection.

Here are some snippets from our exchange:

> The data from the shapefile is in NAD 27, GRS80.  Which I  think is  
> EPSG 4326.  I had the epsg for the mapfile set to 54004, because I  
> created it for wms output to google maps which uses that projection.
  - I think it's EPSG:4269: http://spatialreference.org/ref/epsg/4269

>  I  just realized that I may have the projection wrong  - it looks  
> as though that shapefile is in NAD83.  How do I figure out the epsg  
> for that?
  - You have a .prj file, which, if exists, defines the coord sys for  
the data.  Eyeballing the .prj file and checking http:// 
spatialreference.org/ tells me that EPSG:4269 corresponds to this.


********* Key Point ********
Remember, WFS can only output ONE SRS, usually the native SRS of the
data.  WMS can output MANY SRSs, hence MAP/WEB/METADATA/wms_srs.

  - Thanks, Tom.

At the bottom of this message is the mapfile that Tom created.
This is the original mapfile:

###########################

MAP
  NAME "roadless"
  STATUS ON
  SIZE 800 600
  STATUS ON
  EXTENT -124.40950012207 18.2457218170166 -65.7071533203125
49.0011405944824
  SHAPEPATH "../shapefiles"
  FONTSET ../fonts/fonts.txt
  PROJECTION
   "init=epsg:54004"
  END

  WEB
   IMAGEPATH "/tmp/"
   IMAGEURL "/tmp/"
   METADATA
    "wfs_title"   "ira_wfs"
    "wms_srs" "EPSG:4326"
   END
  END

  LAYER
   NAME "ira"
   TYPE POLYGON
   METADATA
    "wfs_title"    "ira"
    "gml_include_items" "all"
    "wfs_featureid" "ID"
   END
   PROJECTION
    "proj=latlong"
    "ellps=GRS80"
    "datum=NAD27"
   END
   EXTENT -124.40950012207 18.2457218170166 -65.7071533203125
49.0011405944824
   DUMP TRUE
   DATA ira_by_name_nad83
   STATUS ON
   CLASS
    STYLE
     COLOR 255 0 0
    END
   END
  END
END

###########################

MAP
  NAME test
  IMAGETYPE PNG
  STATUS ON
  EXTENT -124.409498 18.245724 -65.707153 49.001137
  SIZE 500 300
  SYMBOLSET "../../etc/symbols/symbols.sym"
  FONTSET   "../../etc/fonts/fonts.txt"
  IMAGECOLOR 125 125 125

  PROJECTION
   "init=epsg:4269"
  END

  DEBUG ON

  TRANSPARENT ON

  WEB
   HEADER "../../etc/templates/query_header.html"
   FOOTER "../../etc/templates/query_footer.html"
   IMAGEPATH "../../tmp/"
   IMAGEURL  "/ms_tmp"
   METADATA
    "ows_title"    "test Web Services"
    "ows_abstract" "test Web Services"
    "ows_keywordlist" "kw1,kw2"
    "ows_service_onlineresource" "http://www.example.org/"
    "ows_fees" "none"
    "ows_accessconstraints" "none"

    # OGC:WMS

    "wms_feature_info_mime_type"  "text/html"

    "wms_addresstype" "postal"
    "wms_address"     "867 Lakeshore Road"
    "wms_city" "Burlington"
    "wms_stateorprovince" "Ontario"
    "wms_postcode" "L7R-4A6"
    "wms_country" "Canada"
    "wms_contactelectronicmailaddress" "tom.kralidis at ec.gc.ca"
    "wms_contactvoicetelephone" "+01-905-336-4409"
    "wms_contactfacsimiletelephone" "+01-905-336-4499"
    "wms_contactperson" "Tom Kralidis"
    "wms_contactorganization" "Environment Canada"
    "wms_contactposition" "Senior Systems Scientist"

    "wms_srs" "EPSG:4326 EPSG:2294 EPSG:2295 EPSG:4267 EPSG:4269 EPSG: 
26707 EPSG:26708 EPSG:26709 EPSG:26710 EPSG:26711 EPSG:26712 EPSG: 
26713 EPSG:26714 EPSG:26715 EPSG:26716 EPSG:26717 EPSG:26718 EPSG: 
26719 EPSG:26720 EPSG:26721 EPSG:26722 EPSG:26907 EPSG:26908 EPSG: 
26909 EPSG:26910 EPSG:26911 EPSG:26912 EPSG:26913 EPSG:26914 EPSG: 
26915 EPSG:26916 EPSG:26917 EPSG:26918 EPSG:26919 EPSG:26920 EPSG: 
26921 EPSG:26922 EPSG:42101 EPSG:42304"
    "wms_attribution_onlineresource" "http://www.example.org/"
    "wms_attribution_title" "Data from example.org"
    "wms_attribution_logourl_width" "439"
    "wms_attribution_logourl_height" "68"
    "wms_attribution_logourl_format" "image/jpeg"
    "wms_attribution_logourl_href" "http://mapserver.gis.umn.edu/ 
logo.jpg"
   END
  END

  QUERYMAP
   STATUS OFF
   SIZE 400 300
   STYLE HILITE
   COLOR 255 255 0
  END

  LEGEND
   LABEL
    SIZE 10
    TYPE TRUETYPE
    FONT verdana
    COLOR 0 0 0
   END
  END

  LAYER
   NAME "ira"
   STATUS ON
   DEBUG ON
   DATA "ira_by_name_nad83.shp"
   TYPE POLYGON
   DUMP TRUE
   HEADER "ttt.html"
   TEMPLATE "ttt.html"
   TOLERANCE 30
   METADATA
    "ows_title"    "ira"
    "ows_abstract" "ira"
    "ows_keywordlist" "kw1,kw2"
    "wms_opaque" "0"
    "ows_metadataurl_type" "FGDC"
    "wms_metadataurl_format" "text/html"
    "ows_metadataurl_href" "http://www.example.org/foo.fgdc"
    "wfs_metadataurl_format" "XML"
    "gml_include_items" "all"
    "wfs_featureid" "ID"
   END
   CLASS
    NAME " "
    COLOR 0 255 0
    OUTLINECOLOR 0 0 0
    STYLE
      SIZE 10
    END
   END
  END
END


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20071231/f3f11f67/attachment.htm>


More information about the MapServer-users mailing list