Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I try to display the data that I have converted shp into PostGIS database with MapServer and OpenLayers. When I try to show directly shp file is successfully displayed in OpenLayers, but when I try to display the data shp that has been stored in PostGIS can not be displayed in OpenLayers. I had several times looking for this solution in the forums but the result is still an error. Below is the map file that I use.

  1. postgis.config for connection
CONNECTIONTYPE POSTGIS
CONNECTION "host=localhost dbname=postgisprime user=postgres port=5432 password=admin"
PROCESSING "CLOSE_CONNECTION=DEFER"
  1. config.inc.map for projection
CONFIG PROJ_LIB "/ms4w/proj/nad/" 

3. post.map for layer

LAYER  
    NAME    Base
    TYPE    polygon
    STATUS  ON
    DUMP    TRUE
    INCLUDE "postgis.config"
    DATA    "geom FROM \"provinces\" USING UNIQUE gid using srid=1"

METADATA
    ows_title "Base"
    gml_include_items "all"
    wfs_include_items "all"
    ows_featureid "gid"
    ows_enable_request   "*"
END

CLASS       
    COLOR 242 239 232
  END # class
 END # layer    
END

4.postgisbase.map

MAP  
INCLUDE "config.inc.map"
NAME "postgisbase"  #name to give your map service
EXTENT 221238 881125 246486 910582
UNITS meters
CONFIG      "MS_ERRORFILE" "D:/ms4w/tmp/ms_error.txt"

PROJECTION 
   "init=epsg:4326"
END   
WEB
    MINSCALEDENOM 100
    MAXSCALEDENOM 100000
METADATA
        ows_title "PostGIS "
        #ows_onlineresource "http://www.postgis.us/demo/chapter_11/GetPAMap.ashx?"
        wms_version "1.1.1"
        wms_srs   "EPSG:2249 EPSG:4326 EPSG:26986 EPSG:3785 EPSG:900913"
        wfs_version "1.0.0"
        wfs_srs   "EPSG:4326"
    END
  END #End Web
INCLUDE "post.map"
END # Map File

and this the script for call the postgisbase.map in openlayers

var Ina = new OpenLayers.Layer.WMS( "Peta Dunia", "../../../cgi-bin/mapserv.exe?MAP=D:/ms4w/apps/AIS/postgisbase.map", {layers:'base'},{wrapDateLine: true},{sphericalMercator: true});

and the error when i try to load the page is

[Wed Oct 26 13:52:32 2011].171000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:32 2011].312000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:32 2011].375000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:32 2011].718000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:32 2011].734000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:32 2011].750000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:32 2011].750000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].0 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].78000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].250000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].328000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].359000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].437000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].515000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].687000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].812000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].906000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].953000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].984000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:33 2011].984000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:34 2011].140000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)
[Wed Oct 26 13:52:34 2011].156000 loadLayer(): Unknown identifier. Parsing error near (provinces):(line 46)

Any suggest for this error ?

share|improve this question
    
First suggestion: format your questions correctly, it will help us to help you. Getting down to the actual question we need to know the following to help you out: 1. the GROUP element is repeated, get rid of the duplicate 2. we need to see the included file as well 3. the error mentions line 109: which line is 109? –  unicoletti Oct 25 '11 at 9:23
    
I try to display the data shp that I have converted into PostGIS database with MapServer and OpenLayers. When I try to show directly shp is successfully displayed in OpenLayers, but when I try to display the data shp has been stored in PostGIS can not be displayed in OpenLayers. I had several times looking for this solution in the forums but the result is still an error. Below is the map file that I use. –  budiyanto Oct 26 '11 at 5:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.