TR: [Mapserver-users] Re: VirtualSpatialData (OGR Connectiont ype)

Julien, Heryk hjulien at nrcan.gc.ca
Fri Jan 23 12:41:12 PST 2004


Hi Norm,
Here is a shortenend version of my mapfile:


NAME Field_cap
	EXTENT 38052.652500 4880535.418450 555731.152500 5398894.333450
	SHAPEPATH "d:\webcgcq\lcnp\mapserver_demo\maritimes\data\shp\geo83"
	UNITS meters
	FONTSET "d:\webcgcq\lcnp\mapserver_demo\maritimes\fonts\fontset.dat"
	SYMBOLSET
"d:\webcgcq\lcnp\mapserver_demo\maritimes\symbols\symbolset.sym"
	SIZE 400 400
	IMAGECOLOR 255 255 255
	TRANSPARENT ON

PROJECTION  
	"init=epsg:26920"
END #projection

WEB
	TEMPLATE "d:\webcgcq\lcnp\mapserver_demo\maritimes\demo4.html"
	IMAGEPATH "d:\webcgcq\temp\"
	IMAGEURL "/temp/"  
#	EMPTY
"http://cgcq.rncan.gc.ca/GASL_clf/mapserver/templates/MS_query_noSel.html" 
	METADATA
		"wms_title" "Field_cap"
		"wms_onlineresouce"
"http://www.cgcq.rncan.gc.ca/cgi-bin/mapserver400/mapserv.exe?map=d:\webcgcq
\lcnp\mapserver_demo\maritimes\mapfiles\StatField3.map&"
		"wms_srs" "EPSG:4269 EPSG:26920"
		"wms_feature_info_mime_type" "Text/html"
	END
END

LEGEND
	STATUS ON
	IMAGECOLOR 200 200 200
	LABEL
		TYPE TRUETYPE
		FONT arial
		COLOR 0 0 0
		SIZE 10
	END
END  
 

SCALEBAR
  	STATUS ON
  	IMAGECOLOR 238 238 255	
	POSITION lc
  	SIZE 200 5
  	COLOR 255 255 255
  	BACKGROUNDCOLOR 0 0 0
  	OUTLINECOLOR 0 0 0
  	INTERVALS 5
  	UNITS KILOMETERS
	STYLE 0
  	LABEL
  		COLOR 0 0 0
  		SIZE SMALL
  	END
END #SCALEBAR

QUERYMAP
	SIZE 200 150
	STATUS ON
	STYLE HILITE
	COLOR 255 255 0
END

REFERENCE
	COLOR  -1 -1 -1
	EXTENT -150900 4756000 884457 5596000
	STATUS ON
	OUTLINECOLOR 255 0 0
	SIZE 135 95
 	IMAGE
"d:\webcgcq\lcnp\mapserver_demo\maritimes\data\raster\refmgwiclr.jpg"
END

LAYER # Centre d'information Topographique - CIT Sherbrooke
    NAME "CANIMAGE:CanImage/CanImage"
    TYPE RASTER
    OFFSITE 0 0 0
    STATUS on
    CONNECTIONTYPE WMS
    CONNECTION "http://wms.cits.rncan.gc.ca/cgi-bin/cubeserv.cgi?"
    METADATA
      "wms_title" "CANIMAGE"
      "wms_name" "CANIMAGE:CanImage/CanImage"
      "wms_server_version" "1.1.0"
      "wms_srs" "epsg:26920"
      "wms_format" "image/jpeg"
   END
   PROJECTION
      "init=epsg:26920"
    END
END #	

LAYER
	NAME "MGWI_TBLLOC"
	TYPE POINT
	CONNECTIONTYPE OGR
	CONNECTION
"D:\webCGCq\lcnp\mapserver_demo\maritimes\data\shp\geo83\mgwi.ovf"
	DATA "MGWI_TBLLOC"
	STATUS default
	LABELITEM locid
	PROJECTION
		"init=epsg:26920"
	END #projection
	CLASS
		SYMBOL 1
		SIZE 8
		COLOR 255 0 0
		LABEL
			SIZE MEDIUM
			TYPE BITMAP
			COLOR 0 0 0
		END # end of label
	END # CLASS
END # LAYER

END



My ODBC connection: MGWI_MAPSERVER
The name of my Access file is mgwi_transit2000.mdb.
Table name: tblloc
The fields I am interested in are: locid (text 50), loc_ref (text 50),
loc_alias (text 255), X (double), Y (double).


The ovf file:
<OGRVRTDataSource>
    <OGRVRTLayer name="MGWI_TBLLOC">
	<SrcDataSource>ODBC:MGWI_MAPSERVER,tblloc</SrcDataSource> 
 	<SrcLayer>tblloc</SrcLayer> 
	<GeometryType>wkbPoint</GeometryType>
	<GeometryField encoding="PointFromColumns" x="X" y="Y"/> 
    </OGRVRTLayer>
</OGRVRTDataSource>


Thanks again.

Héryk

-----Message d'origine-----
De : Normand Savard [mailto:nsavard at dmsolutions.ca]
Envoyé : Friday, January 23, 2004 2:53 PM
Cc : 'Mapserver-users at lists.gis.umn.edu'
Objet : Re: TR: [Mapserver-users] Re: VirtualSpatialData (OGR
Connectiontype)


Julien,

Is it possible to see the map projection section or if your map file is 
not too long could you copy it here?  Also, could you joined your 
database structure?

Norm

Julien, Heryk wrote:

>Has anyone ever tried connecting to Access 2000?
>That may be the problem.
>Is so I'll have to use a different db software!
>Unfortunatly almost everyone in my office works with Access 2000.
>
>Thank you all for your patience and help
>Cheers
>Héryk
>
>-----Message d'origine-----
>De : Arthur, John [mailto:John.Arthur at T-Mobile.com]
>Envoyé : Friday, January 23, 2004 2:09 PM
>À : 'Julien, Heryk'; 'Frank Warmerdam'
>Cc : 'Zak James'; 'Normand Savard'; 'Mapserver-users at lists.gis.umn.edu';
>Anctil, Martin; 'spencer at dmsolutions.ca'
>Objet : RE: [Mapserver-users] Re: VirtualSpatialData (OGR
>Connectiontype)
>
>
>I'm using windows with MSSQL for this one.  In your CONNECTION tag, try
>using "/" instead of "\":
>"D:/webCGCq/lcnp/mapserver_demo/maritimes/data/shp/geo83/mgwi.ovf"
>
>-----Original Message-----
>From: Julien, Heryk [mailto:hjulien at nrcan.gc.ca]
>Sent: Friday, January 23, 2004 2:03 PM
>To: 'Frank Warmerdam'; Arthur, John
>Cc: 'Zak James'; 'Normand Savard'; 'Mapserver-users at lists.gis.umn.edu';
>Anctil, Martin; 'spencer at dmsolutions.ca'
>Subject: RE: [Mapserver-users] Re: VirtualSpatialData (OGR
>Connectiontype)
>
>
>Okay,
>If run the orginfo with the ODBC connection name (MGWI_TBLLOC) instead of
>the Access table name (tblloc) I get my table content. Thanks.
>
>Now I'm back to the original problem. All the components seem to work
>perfectly but I keep on getting the same error message when I try to draw
>the map:
>
>msDrawMap(): Image handling error. Failed to draw layer named
'MGWI_TBLLOC'.
>
>msOGRFileOpen(): OGR error. Open failed for OGR connection
>`D:\webCGCq\lcnp\mapserver_demo\maritimes\data\shp\geo83\mgwi.ovf'. File
not
>found or unsupported format.
>
>It doesn't seem to find the mgwi.ovf file. I tried both relative and
>absolute paths. I checked my mapfile and everyting seems okay
>
>LAYER
>	NAME "MGWI_TBLLOC"
>	TYPE POINT
>	CONNECTIONTYPE OGR
>	CONNECTION
>"D:\webCGCq\lcnp\mapserver_demo\maritimes\data\shp\geo83\mgwi.ovf"
>	DATA "MGWI_TBLLOC"
>	STATUS default
>	LABELITEM locid
>	PROJECTION
>		"init=epsg:26920"
>	END #projection
>	CLASS
>		SYMBOL 1
>		SIZE 8
>		COLOR 255 0 0
>		LABEL
>			SIZE MEDIUM
>			TYPE BITMAP
>			COLOR 0 0 0
>		END # end of label
>	END # CLASS
>END # LAYER
>
>
>John, are you using an Access database? Are you working on Linux or Window?
>
>
>Thank you all for your help
>Héryk
>
>mgwi.ovf:
>
><OGRVRTDataSource>
>    <OGRVRTLayer name="MGWI_TBLLOC">
>	<SrcDataSource>ODBC:MGWI_MAPSERVER,tblloc</SrcDataSource> 
> 	<SrcLayer>tblloc</SrcLayer> 
>	<GeometryType>wkbPoint</GeometryType>
>	<GeometryField encoding="PointFromColumns" x="X" y="Y"/> 
>    </OGRVRTLayer>
></OGRVRTDataSource>
>
>
>
>
>-----Message d'origine-----
>De : Frank Warmerdam [mailto:warmerdam at pobox.com]
>Envoyé : Friday, January 23, 2004 10:24 AM
>À : Julien, Heryk
>Cc : 'Zak James'; 'Arthur, John'; 'Normand Savard';
>'Mapserver-users at lists.gis.umn.edu'; Anctil, Martin;
>'spencer at dmsolutions.ca'
>Objet : Re: [Mapserver-users] Re: VirtualSpatialData (OGR
>Connectiontype)
>
>
>Julien, Heryk wrote:
>  
>
>>Hi,
>>I tried it and I don't get the table content!
>>
>>Firt try:
>>D:\WebScripts\MapServer>ogrinfo
>>D:\webCGCq\lcnp\mapserver_demo\maritimes\data\shp\geo83\mgwi.ovf
>>
>>ERROR 4: Update access not supported for VRT datasources.
>>Had to open data source read-only.
>>INFO: Open of
>>`D:\webCGCq\lcnp\mapserver_demo\maritimes\data\shp\geo83\mgwi.ovf'
>>using driver `VRT' successful.
>>1: MGWI_TBLLOC (Point)
>>
>>
>>
>>Second try with the table name:
>>D:\WebScripts\MapServer>ogrinfo
>>D:\webCGCq\lcnp\mapserver_demo\maritimes\data\shp\geo83\mgwi.ovf tblloc
>>
>>ERROR 4: Update access not supported for VRT datasources.
>>Had to open data source read-only.
>>INFO: Open of
>>`D:\webCGCq\lcnp\mapserver_demo\maritimes\data\shp\geo83\mgwi.ovf'
>>using driver `VRT' successful.
>>
>>
>>
>>The table doesn't seem to be coming through! Any idea?
>>
>>I tried the new build that Paul made available this morning and I get the
>>same problem! 
>>    
>>
>
>Hi,
>
>I'm not sure if I missed some of the email on this thread (it is pretty
>overwhelming!) but you didn't use the correct table name in your ogrinfo
>query.  When you ran ogrinfo without the layer name you got "1: MGWI_TBLLOC
>(Point)" as the result.  The "MGWI_TBLLOC" portion of this is the layer
>name.  So you should use it, not TBLLOC as the layer name in your ogrinfo
>query:
>
>Good luck,
>  
>


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list