[OpenLayers-Users] General question and GML question

Christopher Schmidt crschmidt at metacarta.com
Fri Dec 5 10:51:49 EST 2008


On Fri, Dec 05, 2008 at 11:42:30AM -0400, Ken Sanderson wrote:
> Hi everyone, this is about my third time giving OpenLayers a try and 
> this time I thought I would bite the bullet and ask some questions 
> instead of just going back to my mapserver setup.
> 
> First a general best approach question. What I want to do is use google 
> data and put a simple polygon boundary on top. That boundary is 
> currently in a shape file. My thinking was to convert the shp file to 
> gml and just add it as a layer. I have since read that this maybe 
> tricker then I thought as google data is in a mercator projection that 
> does not have an EPSG code. 

OpenLayers has a built in ability to convert between EPSG:4326 (lat/lon)
and Google's Mercator projection: see
http://docs.openlayers.org/spherical_mercator/#reprojecting-vector-data
for more information on how to use it.

> Second more specific to the use of GML layers. I converted my shp file 
> to GML using gvSIG and in another attempt shp2gml from spatial order. I 
> cannot get my GML file to be viewable. Thinking it might be a projection 
> issue I thought I would just display my GML file on its own, to avoid 
> any conflicting projections, but that hasnt worked either. Using the 
> gml-layer.html example I tried to work backwards and put my GML file in 
> there, no luck.

Can you share the GML file you generated? It's possible this is a
version problem, or some other parsing error: without seeing the GML
file (or a sample file that fails) it's hard to know for sure.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list