Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid projection #90

Open
rclark opened this issue Mar 3, 2015 · 6 comments
Open

Invalid projection #90

rclark opened this issue Mar 3, 2015 · 6 comments

Comments

@rclark
Copy link
Contributor

rclark commented Mar 3, 2015

Using a tif downloaded from http://www.gisat.cz/content/en/products/data-download, omnivore is unable to determine the projection of this file.

digest ~/tmp/strange-projection.tif 

/Users/r/gh/mapbox/mapnik-omnivore/lib/raster.js:78
  var current = new mapnik.Projection(this.projection);
                ^
Error: failed to initialize projection with: ''
    at Raster.getExtent (/Users/r/gh/mapbox/mapnik-omnivore/lib/raster.js:78:17)
    at Raster.getCenter (/Users/r/gh/mapbox/mapnik-omnivore/lib/raster.js:67:8)
    at /Users/r/gh/mapbox/mapnik-omnivore/index.js:80:12
    at pop (/Users/r/gh/mapbox/mapnik-omnivore/node_modules/queue-async/queue.js:24:14)
    at /Users/r/gh/mapbox/mapnik-omnivore/node_modules/queue-async/queue.js:38:39
    at /Users/r/gh/mapbox/mapnik-omnivore/index.js:75:7
    at Object.oncomplete (fs.js:108:15)

gdalinfo gives the projection information as:

LOCAL_CS["KRON        D211",
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-907000.000000000000000,-933000.000000000000000)
Pixel Size = (250.000000000000000,-250.000000000000000)

cc @GretaCB @bsudekum

@knutole
Copy link

knutole commented Apr 9, 2015

I got here from getting the same error on same file. 🎱 Did you get anywhere with this? EPSG::9001 doesn't seem to be a valid EPSG, though.

This is metadata from a text file embedded with the raster:

 Image Format           :    GeoTIFF (No Compression)
 Image Size             :    4780 Columns x 2970 Lines x 3 Bands
 Image Type             :    16-bit unsigned

 Georeference Units     : KRON        D211
 Projection             : Krovak (negative)
 Datum - Ellipsoid      : S-JTSK (Czechia) - Bessel 1841
 Grid units             : METRE

 Upper Left  Corner     :      -907000.000  E        -933000.000  N 
 Upper Right Corner     :      -429000.000  E        -933000.000  N 
 Image Centre           :      -668000.000  E       -1081500.000  N 
 Lower Left  Corner     :      -907000.000  E       -1230000.000  N 
 Lower Right Corner     :      -429000.000  E       -1230000.000  N 

 Pixel Size             :          100.000  E            100.000  N 

 Upper Left  Corner     :  11d53'57.97" E  Lon   50d50'24.00" N  Lat
 Upper Right Corner     :  18d40'22.13" E  Lon   51d22'36.52" N  Lat
 Image Centre           :  15d31'32.56" E  Lon   49d49'54.52" N  Lat
 Lower Left  Corner     :  12d34'37.17" E  Lon   48d12'22.45" N  Lat
 Lower Right Corner     :  18d59'48.63" E  Lon   48d42'54.36" N  Lat

@wilhelmberg
Copy link
Contributor

Using a tif downloaded from http://www.gisat.cz/content/en/products/data-download

Don't know if it helps, but using the same tiff with Gauss-Kruger (S-42) projection works.

image

gdalwarp (gdalwarp -t_srs EPSG:3857 MOS_CZ_GK3_250.tif mos_wm.tif) can reproject the Gauss-Krueger one (so should mapnik-omnivore and node-gdal) and it then overlays nicely with Web Mercator tiles:

image

@wilhelmberg
Copy link
Contributor

The Krovak (S-JTSK) seems to be EPSG:2065 http://spatialreference.org/ref/epsg/2065/

So forcing the source srs to EPSG:2065 produces an acceptable result on the Krovak tif:

gdalwarp -s_srs EPSG:2065 -t_srs EPSG:3857 MOS_CZ_KR_250.tif mos_wm.tif

image

@knutole
Copy link

knutole commented Apr 9, 2015

Thanks for the clarification of this particular raster. The problem I'm having, though, is wanting to do automatic detection of projection, and for some reason gdalinfo returns EPSG:9001. Which doesn't make sense for many reasons, one being that it doesn't exist (apparently). Projections are tricky!

This raster throws corrupt for gdal.SpatialReference.validate(), so at least there's that.

@wilhelmberg
Copy link
Contributor

As I see it the EPSG:9001 just refers to the unit of measure

LOCAL_CS["KRON        D211",
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]

and not to the whole projection (LOCAL_CS["KRON D211").

epsg-registry.org on EPSG:9001

I don't think there is a way to do automatic detection with files like these, that don't a have a coordinate system that can be found in the epsg registry.

@knutole
Copy link

knutole commented Apr 9, 2015

Ok, thanks again for your clarification. I believe you're right. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants