[OpenLayers-Users] How To: Positionate WGS84 tracks intoGauss-Boaga Map

Arnd Wippermann arnd.wippermann at web.de
Sun Nov 4 14:08:35 PST 2012


use of proj4js to transform coordinates from EPSG:4326 to EPSG:3004
http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/PointTrack_Boaga_Projection
.asp
 
the map projection is EPSG:3004, the coordinates in the kml-file are in
projection EPSG:4326.
 
The proj4js projection string 
Proj4js.defs["EPSG:3004"] = "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996
+x_0=2520000 +y_0=0 +ellps=intl +units=m +no_defs";
comes from http://spatialreference.org/ref/epsg/3004/proj4js/
 
Good luck
Arnd

  _____  

Von: Riggi Valerio [mailto:vash.84 at virgilio.it] 
Gesendet: Samstag, 3. November 2012 12:56
An: arnd.wippermann at web.de
Cc: openlayers-users at lists.osgeo.org
Betreff: Re: AW: [OpenLayers-Users] How To: Positionate WGS84 tracks
intoGauss-Boaga Map




By the way: How did you manage to show a tif in your browser?

I manage to show the tiff only on Internet Explorer (using
OpenLayers.Layer.Image), but it is not a problem because it is for a
univerity exam.. 


then you have to add the proj4js javascript library to your application.

Can you show me an example?

This is the Current Track Layer:
new OpenLayers.Layer.PointTrack("Tracks", {
                projection: geographic,
                strategies: [new OpenLayers.Strategy.Fixed()],
                protocol: new OpenLayers.Protocol.HTTP({
                    url: "track.kml",
                    format: new OpenLayers.Format.KML({
                        extractTracks: true,
                        extractStyles: true
                    })
                }),
                dataFrom: OpenLayers.Layer.PointTrack.TARGET_NODE,
                styleFrom: OpenLayers.Layer.PointTrack.TARGET_NODE,
                eventListeners: {
                    "beforefeaturesadded": function(e) {
                        // group the tracks by fid and create one track for
                        // every fid
                        var fid, points = [], feature;
                        for (var i=0, len=e.features.length; i<len; i++) {
                            feature = e.features[i];
                            if ((fid && feature.fid !== fid) || i === len-1)
{
                                this.addNodes(points, {silent: true});
                                points = [];
                            } else {
                                points.push(feature);
                            }
                            fid = feature.fid;
                        }
                        return false;
                    }
                }
            })

Many Thank's
Valerio


Il 02/11/2012 22:59, Arnd Wippermann ha scritto:


if you want reproject feature coordinates from EPSG:4326 (WGS84) to other
projection than EPSG:900913 (SphericalMercator),
 
then you have to add the proj4js javascript library to your application.
 
By the way: How did you manage to show a tif in your browser?
 
Arnd
 
 

  _____  

Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Riggi
Valerio
Gesendet: Freitag, 2. November 2012 21:56
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] How To: Positionate WGS84 tracks intoGauss-Boaga
Map


Hi, I'm tring to track some gps data into a Gauss-Boaga map, but I don't
manage to put the track on the right place, how can I do?

This is the Track layer:
new OpenLayers.Layer.PointTrack("Tracks", {
                projection: geographic,
                strategies: [new OpenLayers.Strategy.Fixed()],
                protocol: new OpenLayers.Protocol.HTTP({
                    url: "track.kml",
                    format: new OpenLayers.Format.KML({
                        extractTracks: true,
                        extractStyles: true
                    })
                }),
                dataFrom: OpenLayers.Layer.PointTrack.TARGET_NODE,
                styleFrom: OpenLayers.Layer.PointTrack.TARGET_NODE,
                eventListeners: {
                    "beforefeaturesadded": function(e) {
                        // group the tracks by fid and create one track for
                        // every fid
                        var fid, points = [], feature;
                        for (var i=0, len=e.features.length; i<len; i++) {
                            feature = e.features[i];
                            if ((fid && feature.fid !== fid) || i === len-1)
{
                                this.addNodes(points, {silent: true});
                                points = [];
                            } else {
                                points.push(feature);
                            }
                            fid = feature.fid;
                        }
                        return false;
                    }
                }
            })

And this is the Gauss-Boaga Projection:
    var options = {
    isBaseLayer: true,
    maxResolution: '0.84686783985005',
    strategies: [new OpenLayers.Strategy.Fixed()],
    displayInLayerSwitcher: true,
    size: new OpenLayers.Size(8745, 6696),
    numZoomLevels: 20
    };

    var gauss = new OpenLayers.Layer.Image(
                'Gauss-Boaga',
                'CTR588140.tif',
                new OpenLayers.Bounds(2556348.9846319141797721,
4227924.4383069388568401,
2563754.8438914027065039,4233595.0653625745326281),       <?php
//left,bottom,right,top ?>
                new OpenLayers.Size(8745, 6696),
                options
            );



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121104/d1467633/attachment-0001.html>


More information about the Users mailing list