[gdal-dev] querry in updating attribute values using ogrdatasource
Hello, I am trying to update shape file with attribute values .I am performing following functionality. QFileInfo table1(_mActiveLayer); //_mActive Layer is name of file opened QString tablename1; tablename1=table1.baseName(); reader = OGRSFDriverRegistrar::Open(_mActiveLayer.toLatin1().data(), TRUE ); if(reader==NULL) { exit(0); } poLayer = reader-GetLayer(0); querrysatatement=UPDATE +tablename1+ set SAL= 500 where EMPCODE = 1 ;//table Name is name of the table releated to _mActiveLayer QByteArray bnewconn = querrysatatement.toLatin1(); conninfonew = new char[bnewconn.length()+1]; strcpy(conninfonew,querrysatatement.toLatin1().data()); poLayer=reader-ExecuteSQL (conninfonew,NULL,dialect.toLatin1().data()); OutPut syntax error in sql statement Environment: Unbuntu 12.04 Gdal version -- 1.9.2 geos version -- 3.3.3 Thanks in advance to all ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Generating Lat, long Cordinates with bearing line and angle
Hello, Thanks in advance I have a *lat, lon* coordinate with a known projection system I assume it a initial point. I want to generate a next Position with the an *angle* with (horizontal/vertical) and *bearing length* in lat,lon coordinates and complete it with angles and bearing lengths to form a polygon Any Help in the above context is highly appreciated ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] To know about centriod of a polygon shape file
Dear All, I am just working on Shape files I am unable to detect duplicate centroids in a shape file .After buffering a polygon does centroids of both will match Any help in greatly appreciated With Regards ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Removing Dangle lines in shape files
Dear All, I am Trying to remove Dangle Lines from a shape file containing OGRLineString (polyline).I am thinking that if a line(2),line(3),line(4) crosses a another line(1) detecting the point of intersection and removing the part beyond line1 . I am employing following code and attaching it. Any suggestion is highly appreciated with Regards rmg_dangles.odt Description: application/vnd.oasis.opendocument.text ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Identifying a line for dangle
hai to All, I am Trying to check for a line (OGRLINESTRING) to be a dangle or not. I am trying it out by checking each feature with remaining feature where any other feature(OGRLINESTRING) crosses its any of the node i am attaching a file any help is greatly appreciated With Regards Dangletxt.odt Description: application/vnd.oasis.opendocument.text ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] creating a shape from another with attributes and values
To All, I am using the following code for creating a shape file from another with the attributes value; i am unable to fetch attribute values from source and change the features from newly created shape files Any Sort of help is greatly appriciated #include main.h #includeQList #includeQStringList #includeQDebug //OGRFeature* TranslateFeature(OGRFeature* poSrcFeature,OGRFeatureDefn *poFeatureDefn); OGRLayer*poSrcLayer; OGRLayer*poDstLayer; OGRDataSource *poDS; OGRDataSource *poODS=NULL; OGRFeature *poDstFeature; OGRFeature *poSrcFeature; OGRFeatureDefn *poFeatureDefn; int main() { int iField; const char *pszDriverName = ESRI Shapefile; OGRSFDriver *poDriver; OGRRegisterAll(); QListdoublefieldid; QListQStringfieldname; const char* str=indiaaa ; poDriver = OGRSFDriverRegistrar::GetRegistrar()-GetDriverByName( pszDriverName ); if( poDriver == NULL ) { printf( %s driver not available.\n, pszDriverName ); exit( 1 ); } poDS = poDriver-Open( /home/support/Images/IND_adm (3)/IND_adm1.shp ); poSrcLayer=poDS-GetLayerByName(IND_adm1); poDriver-DeleteDataSource(firsts1.shp); poODS = poDriver-CreateDataSource( firsts1.shp, NULL ); poDstLayer = poODS-CreateLayer( firsts1,NULL,wkbPolygon); poSrcLayer-ResetReading(); int i; OGRGeometry *poGeometry; // OGRGeometry *bufferGeometry; poDstFeature = OGRFeature::CreateFeature(poDstLayer-GetLayerDefn()); poDstLayer-CreateFeature(poDstFeature); poSrcFeature=poSrcLayer-GetNextFeature(); do{ i=1; OGRFeatureDefn *poFDefn = poSrcLayer-GetLayerDefn(); int iField; for( iField = 0; iField poFDefn-GetFieldCount(); iField++ ) { qDebug()fieldcountpoFDefn-GetFieldCount(); printf(\n); OGRFieldDefn *poFieldDefn = poFDefn-GetFieldDefn( iField ); if( poFieldDefn-GetType() == OFTInteger ) { printf( %d,, poSrcFeature-GetFieldAsInteger( iField ) ); } else if( poFieldDefn-GetType() == OFTReal ) { printf( %.3f,, poSrcFeature-GetFieldAsDouble(iField) ); fieldid.append(poSrcFeature-GetFieldAsDouble( iField )); } else if( poFieldDefn-GetType() == OFTString ) { printf( %s, Name, poSrcFeature-GetFieldAsString(iField) ); fieldname.append(poSrcFeature-GetFieldAsString(iField)); } else { printf( %s,name1, poSrcFeature-GetFieldAsString(iField) ); fieldname.append(poSrcFeature-GetFieldAsString(iField)); } } poGeometry=poSrcFeature-GetGeometryRef(); poDstFeature-SetGeometryDirectly(poGeometry); poDstLayer-CreateFeature(poDstFeature); poDstFeature-SetFID(100); // poDstFeature-SetField(i,str); // this is not modifying // i++; // //poDstFeature-SetFrom(poSrcFeature,true); }while( (poSrcFeature = poSrcLayer-GetNextFeature()) != NULL ); poDstLayer-ResetReading(); qDebug()sizefieldname.size(); OGRDataSource::DestroyDataSource(poODS); } ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] (no subject)
s.r.kriis...@gmail.com ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] errror in building qgis
Hello all, I am trying to build qgis for Qt in fedora I have INSTALLED dependies for Python pyqt. and sip It is building upto following Steps Scanning dependencies of target python_module_qgis_networkanalysis [ 92%] Building CXX object python/CMakeFiles/python_module_qgis_networkanalysis.dir/analysis/network/sipnetworkanalysispart0.cpp.o [ 92%] Building CXX object python/CMakeFiles/python_module_qgis_networkanalysis.dir/analysis/network/sipnetworkanalysispart1.cpp.o [ 92%] Building CXX object python/CMakeFiles/python_module_qgis_networkanalysis.dir/analysis/network/sipnetworkanalysispart2.cpp.o [ 92%] Building CXX object python/CMakeFiles/python_module_qgis_networkanalysis.dir/analysis/network/sipnetworkanalysispart3.cpp.o Linking CXX shared library ../output/python/qgis/networkanalysis.so [ 92%] Built target python_module_qgis_networkanalysis [ 92%] Generating ui_qgsplugininstallerbase.py Any Help for the above Problem is greatly apprieciated Thanking You ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] add my email
s.r.kriis...@gmail.com ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] to store a shapeFile with the following code getting problem assigning goemetries in translateLayer Function
#include main.h#include ogrsf_frmts.h#include ogr_p.h#include cpl_conv.h#include cpl_string.h#include ogr_api.h#include gdal.hstatic int TranslateLayer(OGRLayer *poPassedLayer,OGRDataSource *ODS,char *pszNewLayerName,int eGType);int main( ){ const char *pszFormat = ESRI Shapefile; const char *pszDataSource =india_ds.shp; const char *pszDestDataSource = out.shp; char *pszNewLayerName=NULL; OGRLayer*poLayer; OGRDataSource *poDS; OGRDataSource *poODS=NULL; const char *pszDriverName = ESRI Shapefile; OGRSFDriver *poDriver; OGRRegisterAll(); poDriver = OGRSFDriverRegistrar::GetRegistrar()-GetDriverByName( pszDriverName ); if( poDriver == NULL ) { printf( %s driver not available.\n, pszDriverName ); exit( 1 ); } poODS = poDriver-*CreateDataSource*( out.shp, NULL ); if( poODS == NULL ) { printf( Creation of output file failed.\n ); exit( 1 ); } poDS = poDriver-*Open*( india_ds.shp ); poLayer=poDS-*GetLayerByName*(india_ds); if( poDS == NULL ) { printf( Open failed.\n ); exit( 1 ); } int nLayerCount; OGRLayer** papoLayers = NULL; nLayerCount = poDS-*GetLayerCount*();printf(\n %d,nLayerCount); papoLayers = (OGRLayer**)CPLMalloc(sizeof(OGRLayer*) * nLayerCount);for( int iLayer = 0; iLayer nLayerCount; iLayer++ ){ poLayer = poDS-*GetLayer*(iLayer); papoLayers[iLayer] = poLayer;} pszNewLayerName = CPLStrdup(CPLGetBasename(pszDestDataSource)); printf(%s,pszNewLayerName); printf(\n %d,poLayer-*GetFeatureCount*());int eGType=5; for( int iLayer = 0;iLayer nLayerCount; iLayer++ ){ OGRLayer*poLayer = papoLayers[iLayer]; if (poLayer == NULL) continue; OGRLayer* poPassedLayer = poLayer; if( !TranslateLayer( poPassedLayer, poODS,pszNewLayerName, eGType)); { exit(1); }} return 0;}static int TranslateLayer(OGRLayer *poSrcLayer,OGRDataSource *poDstDS,char *pszNewLayerName,int eGType) {OGRLayer *poDstLayer;OGRFeatureDefn *poSrcFDefn;OGRFeatureDefn *poDstFDefn = NULL;OGRSpatialReference *poOutputSRS; poSrcFDefn = poSrcLayer-*GetLayerDefn*();poOutputSRS = poSrcLayer-*GetSpatialRef*();poDstLayer = poDstDS-*GetLayerByName*(pszNewLayerName); poDstLayer = poDstDS-*CreateLayer*( pszNewLayerName, poOutputSRS, (OGRwkbGeometryType) eGType); poDstLayer-*SetStyleTable*( poSrcLayer-*GetStyleTable* () ); int nSrcFieldCount = poSrcFDefn-GetFieldCount(); printf(%d,nSrcFieldCount ); poDstFDefn = poDstLayer-*GetLayerDefn*(); OGRFeature *poFeature; printf(\n 2 %d,poSrcLayer-*GetFeatureCount*()); OGRFeature *poDstFeature = NULL;poSrcLayer-*ResetReading*(); while((poFeature = poSrcLayer-*GetNextFeature*()) != NULL) { poFeature = poSrcLayer-*GetNextFeature*(); OGRGeometry* poSrcGeometry = poFeature-GetGeometryRef(); poDstFeature = OGRFeature::CreateFeature( poDstLayer-*GetLayerDefn*() ); poDstFeature-*SetFID*( poFeature-GetFID() ); OGRGeometry* poDstGeometry = poDstFeature-GetGeometryRef(); poDstFeature-SetGeometry(poSrcGeometry); } return 0;} ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] to find area of Shape File
i am Trying To Find Area of A Polygon with the Following Code int main(){OGRRegisterAll();OGRLayer *poLayer; OGRFeature *poFeature;OGRDataSource *poDS;poDS = OGRSFDriverRegistrar::Open( first.shp);poLayer = poDS-*GetLayerByName*( first);int nCount=poDS-*GetLayerCount*();printf(%d,nCount); poLayer-*ResetReading*();OGRGeometry *poGeometry; OGRGeometryCollection *PoGC; while((poFeature=poLayer-*GetNextFeature*())!=NULL){int nCnt=poFeature-GetFieldCount();printf(\n %d,nCnt); qDebug()entered;poGeometry=poFeature-GetGeometryRef(); if(poGeometry !=NULL wkbFlatten(poGeometry-*getGeometryType*()) == wkbPolygon) { PoGC-*addGeometry*(poGeometry); double area = PoGC-*get_Area*() ;qDebug() area ; }} return 0;} i am getting Error With Regards siva ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] to find area of shapeFile
___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] saving a shape File after obtaining from intersection from to two different shape Files
___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev