Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a raster with a user defined sinusoidal projection and a shapefile in lat/lng coordinates (I believe this is called 'unprojected'?). I'd like to use ogr/gdal's command line utilities to project the shapefile into the raster's custom projection.

I see that ogr2ogr has a t_srs flag that if I had an EPSG code, I could use to project the shapefile into that local projection. However, I am unsure what to do with my custom raster projection.

Per a comment below, this is the projection info from gdalinfo

Coordinate System is:
LOCAL_CS["SINUSOIDAL",
    UNIT["METERS",1]]
Origin = (-8895140.844619400799274,1111950.484813591465354)
Pixel Size = (463.312713623046989,-463.312713623046989)
Corner Coordinates:
Upper Left  (-8895140.845, 1111950.485) 
Lower Left  (-8895140.845,-4448265.391) 
Upper Right (-2222974.456, 1111950.485) 
Lower Right (-2222974.456,-4448265.391) 
Center      (-5559057.650,-1668157.453) 
share|improve this question
    
by unprojected, if you mean there is no projection defined you would need to define it. It is not possible for it to exist without coordinates, and those coordinates are in some projection. please edit question with further information. –  Brad Nesom Aug 22 '13 at 18:08
1  
Just edited the question. By unprojected I meant that the shapefile was in raw lat/lng coordinates. Is that how I should refer to it? –  Rich Aug 22 '13 at 18:28
    
bit of a misnomer. Not sure if I even use it correctly. unprojected - I consider a shape file that is normally in lat lon but there is no prj file. (assumed) but then you have to guess which dataum. if there is a prj and it is lat lon - I call that wgs84 if the datum is gcs and nad83 if the datum is nad83. often uprojected is used (possibly incorrectly) as - the data is in a plane crs but has no prj with it. –  Brad Nesom Aug 22 '13 at 18:53
    
What is the definition of the user defined sinusoidal projection ($ gdalinfo raster_file) –  Hermann Aug 22 '13 at 18:58
    
@Hermann I added the dump from the gdalinfo. Can I use that directly in ogr2ogr? –  Rich Aug 22 '13 at 20:02

1 Answer 1

up vote 2 down vote accepted

If the lat/lon extents of the raster are around

longitude range: -80 to -20 latitude range: -40 to +10

That is, most of South America extending into the Atlantic Ocean.

You could try to use the well-known text below. The ogr2ogr help page says that you can specify WKT or a file that contains WKT (the latter is easier) if there's no EPSG WKID.

PROJCS["Test_Sinusoidal",
GEOGCS["WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Sinusoidal"],
PARAMETER["False_Easting",0.0],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",0.0],
UNIT["Meter",1.0]]

Some information is at OSR Tutorial.

share|improve this answer
    
Wonderful, that worked. Thank you. –  Rich Aug 23 '13 at 0:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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