1

I have a tif with the following projection:

'+proj=stere +lat_0=1 +lon_0=2 +k=1 +x_0=6 +y_0=7 +datum=WGS84 +units=m +no_defs'

Geoserver doesn't accept these tifs and QGIS is unable to reproject them.

How do I know if this projection is ok and what do I do to correct it if not?

I add the gdalinfo output for reference:

Driver: GTiff/GeoTIFF
Files: xxxxx.tif
Size is 2751, 826
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Stereographic"],
    PARAMETER["latitude_of_origin",1],
    PARAMETER["central_meridian",2],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",6],
    PARAMETER["false_northing",7],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-18.500000000000000,46.500000000000000)
Pixel Size = (0.019992729916394,-0.019975786924939)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( -18.5000000,  46.5000000) (  1d59'59.21"E,  1d 0' 1.29"N)
Lower Left  ( -18.5000000,  30.0000000) (  1d59'59.21"E,  1d 0' 0.75"N)
Upper Right (  36.5000000,  46.5000000) (  2d 0' 0.99"E,  1d 0' 1.29"N)
Lower Right (  36.5000000,  30.0000000) (  2d 0' 0.99"E,  1d 0' 0.75"N)
Center      (   9.0000000,  38.2500000) (  2d 0' 0.10"E,  1d 0' 1.02"N)
Band 1 Block=2751x1 Type=Byte, ColorInterp=Red
Band 2 Block=2751x1 Type=Byte, ColorInterp=Green
Band 3 Block=2751x1 Type=Byte, ColorInterp=Blue
7
  • It might be useful to see the full output from running gdalinfo on your tif. Does QGIS load it? Is it in the right place when you have a background layer? How does it fail to reproject it?
    – Spacedman
    Commented Jun 27, 2018 at 11:45
  • The gdalinfo is useful because most coordinate systems are only valid for a range of coordinate values - you can't have a latitude greater than 90 degrees for example. If your tif has corner coordinates outside the valid range for that projection then something is wrong. But I've just reprojected a raster with that projection so there's nothing wrong with it in itself.
    – Spacedman
    Commented Jun 27, 2018 at 11:52
  • @Spacedman I added the gdalinfo output in the question. In QGIS the tif loads but is not well placed and scaled. I am comparing it to OSM layer. Commented Jun 27, 2018 at 13:07
  • The 3rd and 4th column of the Corner Coordinates are those converted to lat-long via the projection string and show it at around 2 degree E and 1 degree N - off the coast of Africa. The corner coordinates in the original system might be lat-long. Are you expecting the tiff to be 18W to 36E and 30N to 46N in lat-long? More like southern Europe?
    – Spacedman
    Commented Jun 27, 2018 at 14:02
  • @Spacedman yes, I expected it to cover the Mediterranean sea. Commented Jun 27, 2018 at 14:46

2 Answers 2

6

the easy way to check if the projection used is correct is to add reference data from another projection and visually check for consistency.

Based on the parameters of the projection, you can also verify that the projection is suitable for your area of interest. For instance, you have a stereographic projection tangent at lat/long (1,2), so if your data is not somewhere in Central Africa, then your projection is likely to be inappropriate.

What makes me think that there is a potential problem with your projection is the value of your false easting and northing (+x_0 and +y_0). With your unit being meters, a shift of 6 or 7 meters does not make sense. Those values could be degrees, so you should convert them into meter.

2

I created a TIFF with the same size, extent, and coordinate system with the following R code:

r = raster(matrix(2751*826, 826, 2751))
extent(r)=c(-18.5, 36.5, 30,46.5)
r[]=1:ncell(r)
projection(r)='+proj=stere +lat_0=1 +lon_0=2 +k=1 +x_0=6 +y_0=7 +datum=WGS84 +units=m +no_defs'
writeRaster(r, "stereo.tif")

And the gdalinfo looks the same:

$ gdalinfo stereo.tif 
Driver: GTiff/GeoTIFF
Files: stereo.tif
Size is 2751, 826
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Stereographic"],
    PARAMETER["latitude_of_origin",1],
    PARAMETER["central_meridian",2],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",6],
    PARAMETER["false_northing",7],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-18.500000000000000,46.500000000000000)
Pixel Size = (0.019992729916394,-0.019975786924939)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( -18.5000000,  46.5000000) (  1d59'59.21"E,  1d 0' 1.29"N)
Lower Left  ( -18.5000000,  30.0000000) (  1d59'59.21"E,  1d 0' 0.75"N)
Upper Right (  36.5000000,  46.5000000) (  2d 0' 0.99"E,  1d 0' 1.29"N)
Lower Right (  36.5000000,  30.0000000) (  2d 0' 0.99"E,  1d 0' 0.75"N)
Center      (   9.0000000,  38.2500000) (  2d 0' 0.10"E,  1d 0' 1.02"N)
Band 1 Block=2751x1 Type=Float32, ColorInterp=Gray
  Min=1.000 Max=2272326.000 
  Minimum=1.000, Maximum=2272326.000, Mean=1136163.500, StdDev=655964.158
  NoData Value=-3.39999999999999996e+38
  Metadata:
    STATISTICS_MAXIMUM=2272326
    STATISTICS_MEAN=1136163.5
    STATISTICS_MINIMUM=1
    STATISTICS_STDDEV=655964.15823084

When loaded into QGIS it appears as a miniscule raster off the coast of Africa. If I right-click on the layer, choose "Set Layer CRS", and pick the EPSG 4326 CRS:

enter image description here

it reappears over the Mediterranean:

enter image description here

2
  • ok, does that mean we can safely use 4326? Commented Jun 27, 2018 at 16:26
  • 1
    "safely"? I don't know. Contact who supplied you with the TIF and find out what there workflow was that resulted in a TIF in the middle of the ocean. If the raster really is in lat-long EPSG:4326 with those extents then that looks pretty safe, but again, check upstream.
    – Spacedman
    Commented Jun 27, 2018 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.