getting data using SHP provider

7 messages Options
Embed this post
Permalink
VJ

getting data using SHP provider

Reply Threaded More More options
Print post
Permalink
Hello,

I'm trying to select data using the SHP provider (version 3.4), but get the exception "Fdo Class Identifiers that contain scopes are not supported. " The same code works for the PostGIS provider; but I can't seem to find just what it is I'm doing wrong: I seem to be stay within the capabilities of the SHP provider...
This is the code:
-
FdoPtr<FdoISelect> sampleSelect = (FdoISelect *) fdoConnection->CreateCommand(FdoCommandType_Select);
sampleSelect->SetFeatureClassName(L"signs.shp");

FdoPtr<FdoIdentifier> queryPropertyName;
queryPropertyName = FdoIdentifier::Create(L"gid");

FdoPtr<FdoDataValue> queryPropertyValue;
queryPropertyValue = FdoDataValue::Create(2);

FdoPtr<FdoFilter> filter;
filter = FdoComparisonCondition::Create(queryPropertyName,FdoComparisonOperations_EqualTo, queryPropertyValue);      

sampleSelect->SetFilter(filter);
     
FdoPtr<FdoIFeatureReader>  sampleSelect->Execute(); // throws the exception
-

Thanks!
Dan Stoica

RE: getting data using SHP provider

Reply Threaded More More options
Print post
Permalink
> sampleSelect->SetFeatureClassName(L"signs.shp");

Try without ".shp" suffix.

Dan.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of VJ
Sent: Friday, February 20, 2009 8:50 AM
To: [hidden email]
Subject: [fdo-users] getting data using SHP provider


Hello,

I'm trying to select data using the SHP provider (version 3.4), but get the
exception "Fdo Class Identifiers that contain scopes are not supported. "
The same code works for the PostGIS provider; but I can't seem to find just
what it is I'm doing wrong: I seem to be stay within the capabilities of the
SHP provider...
This is the code:
-
FdoPtr<FdoISelect> sampleSelect = (FdoISelect *)
fdoConnection->CreateCommand(FdoCommandType_Select);
sampleSelect->SetFeatureClassName(L"signs.shp");

FdoPtr<FdoIdentifier> queryPropertyName;
queryPropertyName = FdoIdentifier::Create(L"gid");

FdoPtr<FdoDataValue> queryPropertyValue;
queryPropertyValue = FdoDataValue::Create(2);

FdoPtr<FdoFilter> filter;
filter =
FdoComparisonCondition::Create(queryPropertyName,FdoComparisonOperations_EqualTo,
queryPropertyValue);

sampleSelect->SetFilter(filter);

FdoPtr<FdoIFeatureReader>  sampleSelect->Execute(); // throws the exception
-

Thanks!
--
View this message in context: http://n2.nabble.com/getting-data-using-SHP-provider-tp2358940p2358940.html
Sent from the FDO Users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
VJ

RE: getting data using SHP provider

Reply Threaded More More options
Print post
Permalink

Dan Stoica wrote:
> sampleSelect->SetFeatureClassName(L"signs.shp");

Try without ".shp" suffix.
Then it throws the exception "FDO class 'signs' not found in schema"...


Jörg
Dan Stoica

RE: getting data using SHP provider

Reply Threaded More More options
Print post
Permalink
Assuming signs.shp exists, how your connection string looks like?

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of VJ
Sent: Friday, February 20, 2009 9:34 AM
To: [hidden email]
Subject: RE: [fdo-users] getting data using SHP provider




Dan Stoica wrote:
>
>> sampleSelect->SetFeatureClassName(L"signs.shp");
>
> Try without ".shp" suffix.
>

Then it throws the exception "FDO class 'signs' not found in schema"...


Jörg

--
View this message in context: http://n2.nabble.com/getting-data-using-SHP-provider-tp2358940p2359194.html
Sent from the FDO Users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
VJ

RE: getting data using SHP provider

Reply Threaded More More options
Print post
Permalink
Dan Stoica wrote:
Assuming signs.shp exists, how your connection string looks like?

The connectionstring reads:
-
DefaultFileLocation=D:\gis_db_interface\sample_data\;TemporaryFileLocation=D:\temp;
-
It was created with the commands
-
ConnDict->SetProperty(L"DefaultFileLocation", L"D:\\gis_db_interface\\sample_data\\");
ConnDict->SetProperty(L"TemporaryFileLocation", L"D:\\temp");
-

The directory holds Signs.shp, Signs.dbf, Signs.idx, Signs.prj, Signs.sbn, Signs.sbx, Signs.shx. The shapefile opens (and shows all attributes) in udig. I also tried with another set of files, but with the same result.



Dan Stoica

RE: getting data using SHP provider

Reply Threaded More More options
Print post
Permalink
Try "Signs" instead of "signs".



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of VJ
Sent: Friday, February 20, 2009 10:05 AM
To: [hidden email]
Subject: RE: [fdo-users] getting data using SHP provider



Dan Stoica wrote:
>
> Assuming signs.shp exists, how your connection string looks like?
>


The connectionstring reads:
-
DefaultFileLocation=D:\gis_db_interface\sample_data\;TemporaryFileLocation=D:\temp;
-
It was created with the commands
-
ConnDict->SetProperty(L"DefaultFileLocation",
L"D:\\gis_db_interface\\sample_data\\");
ConnDict->SetProperty(L"TemporaryFileLocation", L"D:\\temp");
-

The directory holds Signs.shp, Signs.dbf, Signs.idx, Signs.prj, Signs.sbn,
Signs.sbx, Signs.shx. The shapefile opens (and shows all attributes) in
udig. I also tried with another set of files, but with the same result.




--
View this message in context: http://n2.nabble.com/getting-data-using-SHP-provider-tp2358940p2359351.html
Sent from the FDO Users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
VJ

RE: getting data using SHP provider

Reply Threaded More More options
Print post
Permalink
Dan Stoica wrote:
Try "Signs" instead of "signs".
Aaargghh...
When I was typing the post, I also noticed the difference in case...

I now seem to be getting the message that the identifier was not found, but chances are the names/types differ from what I expect. So I'll have to query the identifiers first (in order to get the correct types/names), to make sure I have the correct query.

Thanks for helping me out!