Hi all,<br>
<br>
I&#39;ve been posting in regards to an alignment issue I&#39;ve been having
with a GML layer showing up in the wrong place when overlain on a Mapnik or Openstreet map baselayer. The points were originally collected with a hand-held
gps unit in the late 90&#39;s. I&#39;ve since converted from Shp to GML with
GDAL using ogr2ogr. There&#39;s been some debate as to whether Tunisia is
in Zone 32N or 32S (Epsg 32632 or 32732). I have since assigned both
the SRS (both) using the ogr2ogr -f &quot;gml&quot; -a_srs &quot;epgs:XXXXXX&quot; out.gml
in.shp. This for some reason removes the bounding box, preventing cool
tricks like (if (! map.getCenter) thanks Jan). The GDAL users list
helpfully suggested specifying both the source and target projections,
which I did and works nicely. The GML file aligns exactly over the
island of Jerba near tunisia in ArcGIS anf QGIS in UTM Zone 32N but does not
display in the right place in OL. Both gml files (i.e. same coordinates
plus one with a projection specified) is offset both vertically and
horizontally (somewhere in Algeria), but the points maintain their
spatial relationships to one another. The reassinged gml file also
lines up on top of an unreferenced (i.e. no epsg code attachted). I&#39;ve
tried the reprojection (but on the whole layer, I don&#39;t know if that
will work) and all I get is a firebug error &quot;sites.transform is not a
function.&quot; Also, note that when I set the if (! map.getCenter) to the
prsites layer it doesn&#39;t work.<br>
<ol><li>why does the projectionless GML file in OL show up in the wrong
place, regardless of the EPSG code that I specify (i.e. why doesn&#39;t it
move when I specify a different srs?)</li><li>why does the projected GML file show up in exactly the sample place?</li><li>How do I fix this?</li></ol>
        var map;<br>
        var proj = new OpenLayers.Projection(&quot;EPSG:900913&quot;);<br>
        function init() {<br>
            map = new OpenLayers.Map (&quot;map&quot;, {<br>
                controls:[<br>
                    new OpenLayers.Control.Navigation(),<br>
                    new OpenLayers.Control.PanZoomBar(),<br>
                    new OpenLayers.Control.LayerSwitcher(),<br>
                    new OpenLayers.Control.Attribution()],<br>
                sphericalMercator: true,<br>
                maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),<br>
                maxResolution: 156543.0399,<br>
                numZoomLevels: 19,<br>
                units: &#39;m&#39;,<br>
                        projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>
                displayProjection: new OpenLayers.Projection(&quot;EPSG:32632&quot;),<br>
            } );<br>
            layerMapnik = new OpenLayers.Layer.OSM.Mapnik(&quot;Mapnik&quot;);<br>
            map.addLayer(layerMapnik);<br>
<br>
       sites = new OpenLayers.Layer.GML (<br>
                               &quot;sites.gml&quot;,<br>
                               &quot;sites.gml&quot;,<br>
                               {                                               <br>
                    projection: new OpenLayers.Projection(&quot;EPSG:32632&quot;),<br>
                    format: OpenLayers.Format.GML,<br>
                               }<br>
                    );<br>
    map.addLayer(sites);<br>
     sites.transform (proj, map.getProjectionObject());<br>
     prsites = new OpenLayers.Layer.GML (<br>
                               &quot;pjsites&quot;,<br>
                               &quot;prjtest.gml&quot;,<br>
                               {                                               <br>
                    projection: new OpenLayers.Projection(&quot;EPSG:32632&quot;),<br>
                    format: OpenLayers.Format.GML,<br>
                               }<br>
                    );<br>
    map.addLayer(prsites);<br>
                if( ! map.getCenter() ){<br>
            sites.events.register(&#39;loadend&#39;, sites, function(){map.zoomToExtent(sites.getDataExtent())});<br>
            map.setCenter(null, null);<br>
            };<br>
<br>
        };<br>
<br>
Snippet from the Projected gmlfile<br>
<br>
  &lt;gml:boundedBy&gt;<br>
    &lt;gml:Box&gt;<br>
     
&lt;gml:coord&gt;&lt;gml:X&gt;658618.0000002235&lt;/gml:X&gt;&lt;gml:Y&gt;3722534.999999772&lt;/gml:Y&gt;&lt;/gml:coord&gt;<br>
     
&lt;gml:coord&gt;&lt;gml:X&gt;690975.2797925605&lt;/gml:X&gt;&lt;gml:Y&gt;3752225.999999834&lt;/gml:Y&gt;&lt;/gml:coord&gt;<br>
    &lt;/gml:Box&gt;<br>
  &lt;/gml:boundedBy&gt;                      <br>
  &lt;gml:featureMember&gt;<br>
    &lt;ogr:site2000 fid=&quot;F0&quot;&gt;<br>
      &lt;ogr:geometryProperty&gt;&lt;gml:Point
srsName=&quot;EPSG:32632&quot;&gt;&lt;gml:coordinates&gt;683247.00000048568,3736338.9999997145&lt;/gml:coordinates&gt;&lt;/gml:Point&gt;&lt;/ogr:geometryProperty&gt;<br>
      &lt;ogr:NEWSITE_&gt;14811205&lt;/ogr:NEWSITE_&gt;<br>
      &lt;ogr:UTM_E&gt;683247&lt;/ogr:UTM_E&gt;<br>
      &lt;ogr:UTM_N&gt;3736339&lt;/ogr:UTM_N&gt;<br>
    &lt;/ogr:site2000&gt;<br>
<br>
Snipper from the unprojected GML file.<br>