[gdal-dev] how to store a shapefile afterobtaining from intersection of two different shapeFiles
Chaitanya kumar CH
chaitanya.ch at gmail.com
Thu Jun 28 10:15:02 PDT 2012
Siva,
The library if not adding the single quote character. Check if you have the
file at that location and that you have permissions to read that file.
On Thu, Jun 28, 2012 at 3:15 PM, SIVA RAMA KRISHNA
<s.r.kriishna at gmail.com>wrote:
> hai chaintanya,
>
> I am using following code to Save a Contour . I am opening a dialogBox
> and passing the values from it to another Class with the following code
> void code::SetInterval(int Intr)
> {
>
> Interval =Intr;
>
> }
>
> void code::SetSrcFileName( QString& SrcFname)
> {
>
>
> SrcFileName=SrcFname;
>
>
> }
> void code::SetDestinationFileName(QString& DstFname)
> {
> DstFileName=DstFname;
> // qDebug()<<"destnation"<<DstFname;
> // qDebug()<<"destination"<<DstFileName;
>
>
> }
>
> void code::Execute() { GDALAllRegister(); OGRRegisterAll(); qDebug()<<" in Execute source"<<SrcFileName; // this value is obtained from dialog box qDebug()<<" in Execute destination"<<DstFileName;//this value is obtained from dialog box
> int b3D = FALSE, bNoDataSet = FALSE, bIgnoreNoData = FALSE; int nBandIn = 1; double dfInterval = 0.0, dfNoData = 0.0, dfOffset = 0.0; char *pszSrcFilename = NULL; char *pszDstFilename =NULL; const char *pszElevAttrib = NULL; const char *pszFormat = "ESRI Shapefile"; double adfFixedLevels[1000]; int nFixedLevelCount = 0; int slen; int dlen; pszSrcFilename=new char[SrcFileName.size()+1]; pszDstFilename=new char[DstFileName.size()]; const char *DstFileName1=DstFileName.toLatin1().data(); const char *SrcFileName1=SrcFileName.toLatin1().data();
> slen=strlen(SrcFileName1); dlen=strlen(DstFileName1); qDebug()<<slen; qDebug()<<dlen; strncpy(pszSrcFilename,SrcFileName.toLatin1().data(),slen ); strncpy(pszDstFilename,DstFileName.toLatin1().data(),dlen); qDebug()<<"sourceFileName"<<pszSrcFilename; qDebug()<<"DestinationFileName"<<pszDstFilename; hSrcDS = (GDALDatasetH *) GDALOpen( pszSrcFilename, GA_ReadOnly ); if( hSrcDS == NULL ) exit( 2 );
>
>
> }
>
> I am getting problem while opening through hrscDs with the following Error
> when i am opening File an extra character ' getting addded to
> pszsourcename unabling to OPen
> ERROR 4: `/home/support/Images/DEM/adair.dem' does not exist in the file
> system,
>
> qDebug()<<"sourceFileName"<<pszSrcFilename; qDebug()<<"DestinationFileName"<<pszDstFilename;
>
> this statements are giving correct Names
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>> With Regards
>>>
>>>> siva
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>>
>> --
>> Best regards,
>> Chaitanya kumar CH.
>>
>> +91-9494447584
>> 17.2416N 80.1426E
>>
> Hai Chaitanya,
>
>
--
Best regards,
Chaitanya kumar CH.
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120628/fec2468e/attachment-0001.html>
More information about the gdal-dev
mailing list