Search Results

Search found 5 results on 1 pages for 'proj4js'.

Page 1/1 | 1 

  • Geodjango: importing data from OSGB_1936, displaying in WGS84?

    - by AP257
    I have some polygon data saved in a PostGIS database with projection SRID 27700. geom = models.MultiPolygonField(srid=27700) I want to display the shapes on OpenStreetMap, i.e. with SRID 900913 (I think?). So, two questions: How do I change the code below to output with the right SRID for OpenStreetMap? How can I change the Django code below to give me a nice json object, ready to display as a polygon? area = get_object_or_404(soa.objects, code=my_code) polygon = area.geom return render_to_response('area.html', { 'area': area }, context_instance = RequestContext(request)) Apologies if this question doesn't make sense - I'm pretty new to GeoDjango.

    Read the article

  • Mercator projection world map with Geoserver and Openlayers

    - by bjax-bjax
    I'm trying to render a world map shapefile on my Geoserver with a Mercator projection. I've tried declaring the SRS on Geoserver and defining EPSG projections of 3785 or 900913 in Openlayers with no success. I've also tried to reproject the shapefile using ogr2ogr but the result is slightly off. Original: Converted: Here's the command used: ogr2ogr -t_srs EPSG:3785 target.shp source.shp I'm new to this technology & mapping concepts. Any pointers would be greatly appreciated!

    Read the article

  • How to set default view in OpenLayers, WITHOUT restricting bounds?

    - by Jenny
    Based on samples, I can see that you can set a default view in OpenLayers by saying something along the lines of: var bounds = new OpenLayers.Bounds(-125, 25, -65, 50); var map = new OpenLayers.Map('map', {restrictedExtent: bounds }); However, this also (as the name implies), restricts me to be able to ONLY navigate within these bounds. I can zoom out and see things outside of these bounds, but I can't then zoom back onto them, or scroll to them. I've tried not having any restrictedExtent (or making it the entire map), but then I can't get it to focus on the area I want. I tried using: map.setCenter(new OpenLayers.LonLat(0,0), 3); console.log(map.getCenter()); To set the zoom and the center...but it doesn't seem to do ANYTHING, other than set the variable "center" which I can then read from map.getCenter() (if I don't set it, it's null, if I do set it, I can see it...but the map itself stays fully extended and it's center doesn't seem to change at all...) The Map layer I am using is: OpenLayers.Layer.OSM.Mapnik with displayOutsideMaxExtent set to true... I'm really at a loss here. My goal is to have a default region of the world zoomed in to and in view (such as the United States), with the option of viewers being able to go outside the default to view things.

    Read the article

  • Custom Tile Layer Problem

    - by Myra
    Hi,I'm currently implementing logic on custom tile layers via OpenLayers function getTiles() { var res = this.map.getResolution(); var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)); var z = this.map.getZoom(); return ......; } What I need to is to carry this code in Google API v3. As I searched documentation I found this code to work with: var customtile = new google.maps.ImageMapType({ getTileUrl: function (coord, zoom) { .... .... } Unfortonately,I cannot convert logic in OpenLayers code to Google. As I know resolution is 180 * tileSize.w / Math.pow(2, zoom) //where tileSize is 256x256 Since Google projection is same with my tiles WGS84 boundary should be -180,-90,90,180 I need to calculate to extent coordinates,but in function getTileUrl,there are two arguments.One of which is zoom,but the other coord is some x,y pair which I dont understand what that is.What is that exactly ? How can I generalize formula for calculating tile numbers in Google Maps? Thank you Myra

    Read the article

  • How to transform coordinate from WGS84 to a coordinate in a projection in PROJ.4?

    - by Sanoj
    I have a GPS-coordinate in WGS84 that I would like to transform to a map-projection coordinate in SWEREF99 TM using PROJ.4 in Java or proj4js in JavaScript. Its hard to find documentation for PROJ.4 and how to us it. If you have a good link, please post it as a comment. The PROJ.4 parameters for SWEREF99 TM is +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs I have tried to use a PROJ.4 Java library and tried this code and values: String[] proj4_w = new String[] { "+proj=utm", "+zone=33", "+ellps=GRS80", "+towgs84=0,0,0,0,0,0,0", "+units=m", "+no_defs" }; Projection proj = ProjectionFactory.fromPROJ4Specification(proj4_w); Point2D.Double testLatLng = new Point2D.Double(55.0000, 12.7500); Point2D.Double testProjec = proj.transform(testLatLng, new Point2D.Double()); This give me the point Point2D.Double[5197915.86288144, 1822635.9083898761] but I should be N: 6097106.672, E: 356083.438 What am I doing wrong? and what method and parameters should I use instead? The correct values is taken from Lantmäteriet. I am not sure if proj.transform(testLatLng, new Point2D.Double()); is the right method to use.

    Read the article

1