[fdo-commits] r98 - branches/3.2.x/Providers/WFS/Src/Provider
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Fri Jan 26 15:32:45 EST 2007
Author: romicadascalescu
Date: 2007-01-26 15:32:45 -0500 (Fri, 26 Jan 2007)
New Revision: 98
Modified:
branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSelectCommand.cpp
branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.cpp
branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.h
branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSpatialExtentsAggregateReader.cpp
Log:
Fixed WFS: Fail to get spatial extent
Modified: branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSelectCommand.cpp
===================================================================
--- branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSelectCommand.cpp 2007-01-26 20:17:26 UTC (rev 97)
+++ branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSelectCommand.cpp 2007-01-26 20:32:45 UTC (rev 98)
@@ -139,16 +139,12 @@
// validate the featureType by service metadata
// and at the same time find out the srs name that this feature type uses
FdoString* srsName = L"EPSG:4326";
- if (featureTypeName != NULL) {
+ if (featureTypeName != NULL)
+ {
FdoPtr<FdoWfsServiceMetadata> metadata = mConnection->GetServiceMetadata();
- FdoPtr<FdoWfsFeatureTypeList> typeList = metadata->GetFeatureTypeList();
- FdoPtr<FdoWfsFeatureTypeCollection> featTypes = typeList->GetFeatureTypes();
- FdoPtr<FdoWfsFeatureType> featureType = featTypes->FindItem (mClassName->GetName());
- if (featureType == NULL) {
- featureType = featTypes->FindItem (mClassName->GetText());
- if (featureType != NULL)
+ FdoPtr<FdoWfsFeatureType> featureType = metadata->GetFeatureType(mClassName);
+ if (featureType != NULL)
srsName = featureType->GetSRS();
- }
}
if (featureTypeName == NULL || srsName == NULL) { // no match found
Modified: branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.cpp
===================================================================
--- branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.cpp 2007-01-26 20:17:26 UTC (rev 97)
+++ branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.cpp 2007-01-26 20:32:45 UTC (rev 98)
@@ -209,3 +209,39 @@
desBox->SetSouthBoundLatitude (srcBox->GetSouthBoundLatitude ());
}
+FdoWfsFeatureType* FdoWfsServiceMetadata::GetFeatureType(FdoIdentifier* className)
+{
+ FdoPtr<FdoWfsFeatureTypeCollection> featTypes = m_featureTypeList->GetFeatureTypes();
+ FdoPtr<FdoWfsFeatureType> featureType = featTypes->FindItem (className->GetName());
+ if (featureType == NULL)
+ {
+ featureType = featTypes->FindItem (className->GetText());
+ if (featureType == NULL)
+ {
+ std::wstring lhs = className->GetName();
+ for (int i = 0; i < featTypes->GetCount(); i++)
+ {
+ FdoPtr<FdoWfsFeatureType> fType = featTypes->GetItem(i);
+ std::wstring rhs = fType->GetName();
+ std::wstring::size_type idxSep = rhs.find(L':');
+ bool foundit = false;
+ if (idxSep != std::wstring::npos)
+ {
+ std::wstring::size_type szComp = rhs.size() - (idxSep+1);
+ if(lhs.size() == szComp && !rhs.compare(idxSep+1, szComp < lhs.size() ? lhs.size() : szComp, lhs))
+ foundit = true;
+ }
+ else {
+ if (rhs == className->GetName())
+ foundit = true;
+ }
+ if (foundit)
+ {
+ featureType = fType;
+ break;
+ }
+ }
+ }
+ }
+ return FDO_SAFE_ADDREF (featureType.p);
+}
Modified: branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.h
===================================================================
--- branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.h 2007-01-26 20:17:26 UTC (rev 97)
+++ branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsServiceMetadata.h 2007-01-26 20:32:45 UTC (rev 98)
@@ -27,6 +27,7 @@
class FdoWfsFeatureTypeList;
class FdoWfsOgcFilterCapabilities;
+class FdoWfsFeatureType;
class FdoWfsServiceMetadata : public FdoOwsServiceMetadata
{
@@ -65,7 +66,7 @@
virtual FdoXmlSaxContext* GetSaxContext();
-
+ FdoWfsFeatureType* GetFeatureType(FdoIdentifier* className);
};
Modified: branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSpatialExtentsAggregateReader.cpp
===================================================================
--- branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSpatialExtentsAggregateReader.cpp 2007-01-26 20:17:26 UTC (rev 97)
+++ branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsSpatialExtentsAggregateReader.cpp 2007-01-26 20:32:45 UTC (rev 98)
@@ -30,19 +30,11 @@
{
// Get the cached metadata and feature types
FdoPtr<FdoWfsServiceMetadata> serviceMetadata = conn->GetServiceMetadata ();
- FdoPtr<FdoWfsFeatureTypeList> featTypeList = serviceMetadata->GetFeatureTypeList ();
- FdoPtr<FdoWfsFeatureTypeCollection> featTypes = featTypeList->GetFeatureTypes ();
+ FdoPtr<FdoWfsFeatureType> featureType = serviceMetadata->GetFeatureType(className);
+ if (featureType == NULL)
+ throw FdoCommandException::Create (
+ NlsMsgGet(FDO_NLSID(WFS_NAMED_FEATURETYPE_NOT_FOUND), (FdoString*)className->GetText()));
- // Get the class name and feature type
- FdoPtr<FdoWfsFeatureType> featureType = featTypes->FindItem (className->GetName());
- if (featureType == NULL) {
- featureType = featTypes->FindItem (className->GetText());
- if (featureType == NULL) {
- throw FdoCommandException::Create (
- NlsMsgGet(FDO_NLSID(WFS_NAMED_FEATURETYPE_NOT_FOUND), (FdoString*)className->GetText()));
- }
- }
-
// Get the total extent of the feature type
FdoOwsGeographicBoundingBoxCollectionP extents = featureType->GetSRSExtents();
More information about the fdo-commits
mailing list