andrewxhill / MOL

The Map of Life
mol.colorado.edu/
19 stars 4 forks source link

Extents for Jetz range maps #81

Closed eightysteele closed 12 years ago

eightysteele commented 13 years ago

If you load a Jetz range map, select the layer, and click zoom, the map zooms out to full extent. Need to double check the extents that were stored in MP.info property.

Assigning to @tucotuco.

eightysteele commented 13 years ago

To reproduce, search for 'tyto soumagnei', add the Jetz range map, select it, click zoom. You should zoom into Madagascar. Instead you zoom waaaaay out:

http://demo.mol-lab.appspot.com/admin/sandbox/map

tucotuco commented 13 years ago

I believe this is because the extents are in the raw projected coordinates and not in the map coordinates. This is also likely the cause for all ranges to not have their maps show in the metadata detail. Don't know the solution to that yet.

eightysteele commented 13 years ago

Assigning issue to myself. Changing label to Status-Started.

eightysteele commented 13 years ago

Whoa, ogr.Layer.GetExtents() for zosterops_xanthochrous.shp is:

(18241443.028818697, 18745720.322112225, -2596125.9020476588, -2265080.9167815968)

eightysteele commented 13 years ago

Here's the SRS: +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m +no_defs

So yeah, looks like a projection is needed.

eightysteele commented 13 years ago

Update. Duh. This is a mercator projection so ogr.Layer.GetExtents() is returning coordinates in meters. Juuuuust need to convert those to lat/lon. Easy peasy with a little MapReduce sauce.