Re: [gdal-dev] gdal and hdf-eos
Matt, Did you build GDAL yourself? HDF4 format is not compiled by default. You can check if this by running the command "gdalinfo --formats". See if HDF4 is in the output. http://www.gdal.org/frmt_hdf4.html On Fri, Mar 4, 2011 at 6:03 AM, Matt Funk wrote: > Hi, > i am using python/gdal. I am trying to open a MODIS satellite file from > the Terra satellite (which is hdf4-eos format). Doing: > ds = gdal.Open(file) > drivertype=ds.GetDriver().LongName > > returns > ERROR 4: > `C:/tmp/SrcData/2010Data/MODISData/MOD03/MOD03.A2010002.1810.005.2010258062733.hdf' > not recognised as a supported file format. > > Is this file format not supported? > > thanks > matt > > ___ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev > -- Best regards, Chaitanya kumar CH. /tʃaɪθənjə/ /kʊmɑr/ +91-9494447584 17.2416N 80.1426E ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Python bindings to force geometry collections to mulitpoint, multipolygon, multiline
All, I am currently running gdal 1.7.3, and it appears that in this version the geometry factory methods to force a geometry collection to multipoint, etc. aren't exposed to Python. Am I wrong? If not, are they exposed in gdal 1.8? Dan ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] gdal and hdf-eos
Hi, i am using python/gdal. I am trying to open a MODIS satellite file from the Terra satellite (which is hdf4-eos format). Doing: ds = gdal.Open(file) drivertype=ds.GetDriver().LongName returns ERROR 4: `C:/tmp/SrcData/2010Data/MODISData/MOD03/MOD03.A2010002.1810.005.2010258062733.hdf' not recognised as a supported file format. Is this file format not supported? thanks matt ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Polygon
Alexandre, Can you send your code as a .cpp file as an attachment? Also, I think you should change the line Buffer[size+1]='\0'; to Buffer[size]='\0'; On Thu, Mar 3, 2011 at 6:34 PM, Alexandre Leclerc wrote: > Hello I try to draw a polygon from shapefile on geoconcept. > > > > But the points that I get are corrupted. > > > > Strangely a shapefile with no prj, and one ring in WGS84 works. > > > > Here I try with a prj with lambert 2 extend projection. > > > > The shapefile contains 2 rings. > > > > See my code below. > > > > > > ifstream Prj; > > Prj.open(PrjPath,ios::in); > > > if(Prj.is_open()) > > { > > > > /*---read of PRJ--*/ > > Prj.seekg(0, > ios::end); > > int size = > Prj.tellg(); > > Prj.seekg(0,ios::beg); > > > char * Buffer = new char[size+1]; > > Prj.read(Buffer,size); > > /*---*/ > > > > Buffer[size+1]='\0'; > > > > OGRSpatialReference oSRS, oSRS2; > > OGRCoordinateTransformation *poCT; > > > > oSRS.importFromESRI(&Buffer); > > oSRS2.SetGeogCS( "My geographic coordinate system", > > "WGS_1984", > > "My WGS84 Spheroid", > > SRS_WGS84_SEMIMAJOR, > SRS_WGS84_INVFLATTENING, > > "Greenwich", 0.0, > > "degree", > atoi(SRS_UA_DEGREE_CONV)); > > > > poCT = > OGRCreateCoordinateTransformation(&oSRS,&oSRS2); > > > > > > if((poCT == NULL)||(poPoly->transform(poCT)!= > OGRERR_NONE)) > //Convert lambert 2 to WGS84 > > { > > MessageBox(NULL,"Erreur, > Réessayez","Erreur",MB_ICONERROR); > > PRJ = true; > > return; > > } > > > > } > > Prj.close(); > > > > int nparts = poPoly->getNumInteriorRings(); > > > >if(nparts==0) > > nparts = 1; > > > > for(int > n=0;n //for > npart… > > { > > OGRLinearRing *poRing; > > > > if(poPoly->getNumInteriorRings()>0) > //if I understand correctly, through the function > > poRing = > poPoly->getInteriorRing(n); // > OGRGeometryFactory::organizePolygons() of > > else > > //SHPReadOGRObject, > all the outer rings are converted in inner rings > > poRing = > poPoly->getExteriorRing();//so if there is > more rings than 0, there is many interior rings > > > //else getInteriorRing(n) should be give the N rings > > > //but the function gives one ring with one point which as an incorrect value > > > > > const LPXTNPOINT3D tabPoints = new > XTNPOINT3D[poRing->getNumPoints()];//Tab of points for draw ring > > > > for(i=0;igetNumPoints();i++) > > // Loop To Assign Points good projection > > { > > XTNPROJECTIONINFO xtnProjectionInfo = > XtnStartMapProjection(xtnMapID);// Creating a > projection for the coordinates > > LPXTNPROJECTION lpxtnProjection = new > XTNPROJECTION; > //--- > > > > lpxtnProjection->prLongitude = > poRing->getX(i)*3.1415926535/180; > //Longitude point conversion in Projected > > lpxtnProjection->prLatitude = > poRing->getY(i)*3.1415926535/180; > //Latitude-- > > > > XtnProjection_Do(xtnProjectionInfo, > lpxtnProjection); > //Projection > conversion > > XtnProjection_Destroy(xtnProjectionInfo); > > > > tabPoints[i].X > =((long)((double)(lpxtnProjection->prX * 100.0 + 1.0))) / 100; > //Conversion > long > > tabPoints[i].Y > =((long)((double)(lpxtnProjection->prY * 100.0 + 1.0))) / 100; > > tabPoints[i].Z = 0 ; > > } > > > XtnGeom_SetPoints(MaForme,n,poRing->getNumPoints(),tabPoints); > // Insertion Points in the figure > >} > > > > > > So, can you help me to fix my problem please ? > > > > Sincerely. > > > > ___ > gdal-dev
[gdal-dev] Polygon(suite)
Sorry, I forgot to tell you that I used SHPReadOGRObject for read the SHPObject. put it at the beginning of the code of previous mail SHPHandle hSHP = SHPOpen(chemin.c_str(),"rb"); SHPObject *psShape = SHPReadObject(hSHP,0); OGRGeometry *poPoly = SHPReadOGRObject(hSHP, 0,psShape); Sincerly ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Polygon
Hello I try to draw a polygon from shapefile on geoconcept. But the points that I get are corrupted. Strangely a shapefile with no prj, and one ring in WGS84 works. Here I try with a prj with lambert 2 extend projection. The shapefile contains 2 rings. See my code below. ifstream Prj; Prj.open(PrjPath,ios::in); if(Prj.is_open()) { /*---read of PRJ--*/ Prj.seekg(0, ios::end); int size = Prj.tellg(); Prj.seekg(0,ios::beg); char * Buffer = new char[size+1]; Prj.read(Buffer,size); /*---*/ Buffer[size+1]='\0'; OGRSpatialReference oSRS, oSRS2; OGRCoordinateTransformation *poCT; oSRS.importFromESRI(&Buffer); oSRS2.SetGeogCS( "My geographic coordinate system", "WGS_1984", "My WGS84 Spheroid", SRS_WGS84_SEMIMAJOR, SRS_WGS84_INVFLATTENING, "Greenwich", 0.0, "degree", atoi(SRS_UA_DEGREE_CONV)); poCT = OGRCreateCoordinateTransformation(&oSRS,&oSRS2); if((poCT == NULL)||(poPoly->transform(poCT)!= OGRERR_NONE)) //Convert lambert 2 to WGS84 { MessageBox(NULL,"Erreur, Réessayez","Erreur",MB_ICONERROR); PRJ = true; return; } } Prj.close(); int nparts = poPoly->getNumInteriorRings(); if(nparts==0) nparts = 1; for(int n=0;ngetNumInteriorRings()>0) //if I understand correctly, through the function poRing = poPoly->getInteriorRing(n); // OGRGeometryFactory::organizePolygons() of else //SHPReadOGRObject, all the outer rings are converted in inner rings poRing = poPoly->getExteriorRing(); //so if there is more rings than 0, there is many interior rings //else getInteriorRing(n) should be give the N rings //but the function gives one ring with one point which as an incorrect value const LPXTNPOINT3D tabPoints = new XTNPOINT3D[poRing->getNumPoints()];//Tab of points for draw ring for(i=0;igetNumPoints();i++) // Loop To Assign Points good projection { XTNPROJECTIONINFO xtnProjectionInfo = XtnStartMapProjection(xtnMapID);// Creating a projection for the coordinates LPXTNPROJECTION lpxtnProjection = new XTNPROJECTION; //--- lpxtnProjection->prLongitude = poRing->getX(i)*3.1415926535/180;//Longitude point conversion in Projected lpxtnProjection->prLatitude = poRing->getY(i)*3.1415926535/180; //Latitude-- XtnProjection_Do(xtnProjectionInfo, lpxtnProjection); //Projection conversion XtnProjection_Destroy(xtnProjectionInfo); tabPoints[i].X =((long)((double)(lpxtnProjection->prX * 100.0 + 1.0))) / 100; //Conversion long tabPoints[i].Y =((long)((double)(lpxtnProjection->prY * 100.0 + 1.0))) / 100; tabPoints[i].Z = 0 ; } XtnGeom_SetPoints(MaForme,n,poRing->getNumPoints(),tabPoints); // Insertion Points in the figure } So, can you help me to fix my problem please ? Sincerely. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Re: gdal-dev Digest, Vol 82, Issue 4
Hi Jeff, I was aware of the php_ogr module in the MS4W project...if I was working in the Windows environment I would certainly consider that first for the ogr functionality. But it would also be nice to be able to get this in the Linux environment...as well as to get the gdal and osr modules running. I've updated the trac ticket I submitted (http://trac.osgeo.org/gdal/ticket/3984) with an extra fix that was causing segfaults when using the CreateGeometryFromWkt method in the ogr module. The gdal module still segfaults on startup, however...and I'm sure there's plenty of other bits that will still need fixing. Mike > Date: Wed, 02 Mar 2011 10:46:02 -0400 > From: Jeff McKenna > Subject: Re: [gdal-dev] Re: PHP bindings > To: gdal-dev@lists.osgeo.org > Message-ID: <4d6e582a.5080...@gatewaygeomatics.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > Just a quick note, that MapServer for Windows (MS4W) has always included > the php_ogr extension...and if you are curious about where that project > lives here is how to checkout the php_ogr code through CVS: > > % cvs -d :pserver:cvsa...@cvs.maptools.org:/cvs/maptools/cvsroot login > Password: > > % cvs -d :pserver:cvsa...@cvs.maptools.org:/cvs/maptools/cvsroot co > php_ogr > > Hope that helps. If you have questions about MS4W and its use of the > php_ogr extension please use the MS4W mailing list (subscribe at > http://lists.maptools.org/mailman/listinfo/ms4w-users) > > -jeff ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev