diff --git a/.github/workflows/cmake_builds.yml b/.github/workflows/cmake_builds.yml index e0fe686d72ab..81160f6b6bb5 100644 --- a/.github/workflows/cmake_builds.yml +++ b/.github/workflows/cmake_builds.yml @@ -456,7 +456,7 @@ jobs: # Build PDF driver as plugin due to the PDFium build including libopenjp2 symbols which would conflict with external libopenjp2 run: | mkdir -p $GITHUB_WORKSPACE/build - cmake -G "${generator}" -Werror=dev "-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install-gdal" "-DUSE_CCACHE=ON" "-DCMAKE_PREFIX_PATH=${CONDA}/envs/gdalenv" -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build" -DGDAL_ENABLE_PLUGINS:BOOL=ON -DGDAL_ENABLE_PLUGINS_NO_DEPS:BOOL=ON -DGDAL_USE_PUBLICDECOMPWT:BOOL=ON -DPUBLICDECOMPWT_URL=https://github.com/rouault/PublicDecompWT -DBUILD_JAVA_BINDINGS=OFF -DBUILD_CSHARP_BINDINGS=ON -DGDAL_USE_MYSQL:BOOL=OFF -DCMAKE_C_FLAGS=" /WX" -DCMAKE_CXX_FLAGS=" /WX" -DWERROR_DEV_FLAG="-Werror=dev" -DCMAKE_BUILD_TYPE=Release -DPDFIUM_ROOT=$GITHUB_WORKSPACE/install-pdfium -DGDAL_ENABLE_DRIVER_PDF_PLUGIN:BOOL=ON -DCMAKE_UNITY_BUILD=ON -DOGR_ENABLE_DRIVER_TAB_PLUGIN=OFF -DOGR_ENABLE_DRIVER_GEOJSON_PLUGIN=OFF + cmake -G "${generator}" -Werror=dev "-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install-gdal" "-DUSE_CCACHE=ON" "-DCMAKE_PREFIX_PATH=${CONDA}/envs/gdalenv" -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build" -DGDAL_ENABLE_PLUGINS:BOOL=ON -DGDAL_ENABLE_PLUGINS_NO_DEPS:BOOL=ON -DGDAL_USE_PUBLICDECOMPWT:BOOL=ON -DPUBLICDECOMPWT_URL=https://github.com/rouault/PublicDecompWT -DBUILD_JAVA_BINDINGS=OFF -DBUILD_CSHARP_BINDINGS=ON -DGDAL_USE_MYSQL:BOOL=OFF -DCMAKE_C_FLAGS=" /WX" -DCMAKE_CXX_FLAGS=" /WX" -DWERROR_DEV_FLAG="-Werror=dev" -DCMAKE_BUILD_TYPE=Release -DPDFIUM_ROOT=$GITHUB_WORKSPACE/install-pdfium -DGDAL_ENABLE_DRIVER_PDF_PLUGIN:BOOL=ON -DCMAKE_UNITY_BUILD=ON -DOGR_ENABLE_DRIVER_TAB_PLUGIN=OFF -DOGR_ENABLE_DRIVER_GEOJSON_PLUGIN=OFF -DOGR_ENABLE_DRIVER_NAS=OFF - name: Build shell: bash -l {0} run: cmake --build $GITHUB_WORKSPACE/build --config Release -j 2 diff --git a/frmts/ogcapi/CMakeLists.txt b/frmts/ogcapi/CMakeLists.txt index c6300dd3167c..864520f22614 100644 --- a/frmts/ogcapi/CMakeLists.txt +++ b/frmts/ogcapi/CMakeLists.txt @@ -1,9 +1,3 @@ add_gdal_driver(TARGET gdal_OGCAPI SOURCES gdalogcapidataset.cpp PLUGIN_CAPABLE NO_DEPS) gdal_standard_includes(gdal_OGCAPI) -if(NOT DEFINED OGR_ENABLE_DRIVER_GML) - message(FATAL_ERROR "OGR_ENABLE_DRIVER_GML is not defined") -endif() -if(OGR_ENABLE_DRIVER_GML) - target_include_directories(gdal_OGCAPI PRIVATE ${GDAL_VECTOR_FORMAT_SOURCE_DIR}/gml) - target_compile_definitions(gdal_OGCAPI PRIVATE -DOGR_ENABLE_DRIVER_GML) -endif() +target_include_directories(gdal_OGCAPI PRIVATE ${GDAL_VECTOR_FORMAT_SOURCE_DIR}/gmlutils) diff --git a/frmts/ogcapi/gdalogcapidataset.cpp b/frmts/ogcapi/gdalogcapidataset.cpp index 69750ab7526c..22fae1d09cf6 100644 --- a/frmts/ogcapi/gdalogcapidataset.cpp +++ b/frmts/ogcapi/gdalogcapidataset.cpp @@ -35,9 +35,7 @@ #include "ogrsf_frmts.h" #include "ogr_spatialref.h" -#ifdef OGR_ENABLE_DRIVER_GML #include "parsexsd.h" -#endif #include #include @@ -1649,7 +1647,6 @@ GDALColorInterp OGCAPIMapWrapperBand::GetColorInterpretation() /* ParseXMLSchema() */ /************************************************************************/ -#ifdef OGR_ENABLE_DRIVER_GML static bool ParseXMLSchema(const std::string &osURL, std::vector> &apoFields, @@ -1694,7 +1691,6 @@ ParseXMLSchema(const std::string &osURL, return false; } -#endif /************************************************************************/ /* InitWithTilesAPI() */ @@ -1966,14 +1962,11 @@ bool OGCAPIDataset::InitWithTilesAPI(GDALOpenInfo *poOpenInfo, } } -#ifdef OGR_ENABLE_DRIVER_GML std::vector> apoFields; - bool bGotSchema = false; if (!osXMLSchemaURL.empty()) { - bGotSchema = ParseXMLSchema(osXMLSchemaURL, apoFields, eGeomType); + ParseXMLSchema(osXMLSchemaURL, apoFields, eGeomType); } -#endif for (const auto &tileMatrix : tms->tileMatrixList()) { diff --git a/frmts/wcs/CMakeLists.txt b/frmts/wcs/CMakeLists.txt index 15dcc77801c1..b1d0d3275d4e 100644 --- a/frmts/wcs/CMakeLists.txt +++ b/frmts/wcs/CMakeLists.txt @@ -20,4 +20,4 @@ if(NOT TARGET gdal_WCS) endif() gdal_standard_includes(gdal_WCS) -target_include_directories(gdal_WCS PRIVATE ${GDAL_VECTOR_FORMAT_SOURCE_DIR}/gml) +target_include_directories(gdal_WCS PRIVATE ${GDAL_VECTOR_FORMAT_SOURCE_DIR}/gmlutils) diff --git a/ogr/ogr_p.h b/ogr/ogr_p.h index f4ee626786d1..bf9e80b69d23 100644 --- a/ogr/ogr_p.h +++ b/ogr/ogr_p.h @@ -200,12 +200,10 @@ OGRErr CPL_DLL OGRCheckPermutation(const int *panPermutation, int nSize); /* GML related */ -OGRGeometry *GML2OGRGeometry_XMLNode(const CPLXMLNode *psNode, - int nPseudoBoolGetSecondaryGeometryOption, - int nRecLevel = 0, int nSRSDimension = 0, - bool bIgnoreGSG = false, - bool bOrientation = true, - bool bFaceHoleNegative = false); +OGRGeometry CPL_DLL *GML2OGRGeometry_XMLNode( + const CPLXMLNode *psNode, int nPseudoBoolGetSecondaryGeometryOption, + int nRecLevel = 0, int nSRSDimension = 0, bool bIgnoreGSG = false, + bool bOrientation = true, bool bFaceHoleNegative = false); /************************************************************************/ /* PostGIS EWKB encoding */ diff --git a/ogr/ogrsf_frmts/CMakeLists.txt b/ogr/ogrsf_frmts/CMakeLists.txt index 85998924dbc3..68cc16a6157d 100644 --- a/ogr/ogrsf_frmts/CMakeLists.txt +++ b/ogr/ogrsf_frmts/CMakeLists.txt @@ -45,7 +45,13 @@ ogr_optional_driver(vrt "VRT - Virtual Format") # Caution: if modifying AVC declaration here, also modify it in gdal.cmake ogr_optional_driver(avc AVC) +add_subdirectory(gmlutils) ogr_optional_driver(gml GML) # when not found both EXPAT/XercesC, return error in driver, referenced by WCS +if (OGR_ENABLE_DRIVER_GML_PLUGIN AND + ((NOT DEFINED OGR_ENABLE_DRIVER_NAS OR OGR_ENABLE_DRIVER_NAS)) +) + message(FATAL_ERROR "When building the GML driver as a plugin, the NAS driver must be explicitly disabled with OGR_ENABLE_DRIVER_NAS=OFF") +endif() # ###################################################################################################################### ogr_optional_driver(csv CSV) diff --git a/ogr/ogrsf_frmts/csw/CMakeLists.txt b/ogr/ogrsf_frmts/csw/CMakeLists.txt index a1d8fc1eae6d..b3eb54f8eafa 100644 --- a/ogr/ogrsf_frmts/csw/CMakeLists.txt +++ b/ogr/ogrsf_frmts/csw/CMakeLists.txt @@ -1,6 +1,7 @@ add_gdal_driver( TARGET ogr_CSW SOURCES ogrcswdataset.cpp - BUILTIN) # BUILTIN because of GML and WFS dependency + PLUGIN_CAPABLE + NO_DEPS) gdal_standard_includes(ogr_CSW) -target_include_directories(ogr_CSW PRIVATE $ $) +target_include_directories(ogr_CSW PRIVATE $) diff --git a/ogr/ogrsf_frmts/csw/ogrcswdataset.cpp b/ogr/ogrsf_frmts/csw/ogrcswdataset.cpp index 46774b197c3d..d06fe563d500 100644 --- a/ogr/ogrsf_frmts/csw/ogrcswdataset.cpp +++ b/ogr/ogrsf_frmts/csw/ogrcswdataset.cpp @@ -29,8 +29,9 @@ #include "ogrsf_frmts.h" #include "cpl_conv.h" #include "cpl_http.h" -#include "ogr_wfs.h" #include "ogr_p.h" +#include "ogr_swq.h" +#include "ogrwfsfilter.h" #include "gmlutils.h" extern "C" void RegisterOGRCSW(); diff --git a/ogr/ogrsf_frmts/gml/CMakeLists.txt b/ogr/ogrsf_frmts/gml/CMakeLists.txt index 99d074bc3a51..845a797dcaec 100644 --- a/ogr/ogrsf_frmts/gml/CMakeLists.txt +++ b/ogr/ogrsf_frmts/gml/CMakeLists.txt @@ -1,32 +1,28 @@ add_gdal_driver( TARGET ogr_GML SOURCES gfstemplate.cpp - gmlpropertydefn.cpp gmlreadstate.cpp - gmlutils.h ogrgmldriver.cpp resolvexlinks.cpp - gmlfeature.cpp gmlreader.cpp gmlregistry.cpp hugefileresolver.cpp ogrgmllayer.cpp xercesc_headers.h - gmlfeatureclass.cpp gmlreader.h gmlregistry.h ogr_gml.h - parsexsd.cpp gmlhandler.cpp gmlreaderp.h - gmlutils.cpp ogrgmldatasource.cpp - parsexsd.h - BUILTIN + PLUGIN_CAPABLE + NO_DEPS STRONG_CXX_WFLAGS ) gdal_standard_includes(ogr_GML) +target_include_directories(ogr_GML PRIVATE $) + set(GDAL_DATA_FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/gfs.xsd ${CMAKE_CURRENT_SOURCE_DIR}/data/gml_registry.xml diff --git a/ogr/ogrsf_frmts/gml/gmlreader.h b/ogr/ogrsf_frmts/gml/gmlreader.h index 8e32836cce47..4ea9ad1d089b 100644 --- a/ogr/ogrsf_frmts/gml/gmlreader.h +++ b/ogr/ogrsf_frmts/gml/gmlreader.h @@ -36,6 +36,7 @@ #include "cpl_minixml.h" #include "ogr_core.h" #include "gmlutils.h" +#include "gmlfeature.h" #include #include @@ -43,440 +44,6 @@ // Special value to map to a NULL field #define OGR_GML_NULL "___OGR_GML_NULL___" -typedef enum -{ - GMLPT_Untyped = 0, - GMLPT_String = 1, - GMLPT_Integer = 2, - GMLPT_Real = 3, - GMLPT_Complex = 4, - GMLPT_StringList = 5, - GMLPT_IntegerList = 6, - GMLPT_RealList = 7, - GMLPT_FeatureProperty = 8, - GMLPT_FeaturePropertyList = 9, - GMLPT_Boolean = 10, - GMLPT_BooleanList = 11, - GMLPT_Short = 12, - GMLPT_Float = 13, - GMLPT_Integer64 = 14, - GMLPT_Integer64List = 15, - GMLPT_DateTime = 16, - GMLPT_Date = 17, - GMLPT_Time = 18, -} GMLPropertyType; - -/************************************************************************/ -/* GMLPropertyDefn */ -/************************************************************************/ - -typedef struct -{ - int nSubProperties; - char **papszSubProperties; - char *aszSubProperties[2]; /* Optimization in the case of nSubProperties == - 1 */ -} GMLProperty; - -class CPL_DLL GMLPropertyDefn -{ - char *m_pszName = nullptr; - GMLPropertyType m_eType = GMLPT_Untyped; - int m_nWidth = 0; - int m_nPrecision = 0; - char *m_pszSrcElement = nullptr; - size_t m_nSrcElementLen = 0; - char *m_pszCondition = nullptr; - bool m_bNullable = true; - bool m_bUnique = false; - std::string m_osDocumentation{}; - - CPL_DISALLOW_COPY_ASSIGN(GMLPropertyDefn) - - public: - explicit GMLPropertyDefn(const char *pszName, - const char *pszSrcElement = nullptr); - ~GMLPropertyDefn(); - - const char *GetName() const - { - return m_pszName; - } - - GMLPropertyType GetType() const - { - return m_eType; - } - - void SetType(GMLPropertyType eType) - { - m_eType = eType; - } - - void SetWidth(int nWidth) - { - m_nWidth = nWidth; - } - - int GetWidth() const - { - return m_nWidth; - } - - void SetPrecision(int nPrecision) - { - m_nPrecision = nPrecision; - } - - int GetPrecision() const - { - return m_nPrecision; - } - - void SetSrcElement(const char *pszSrcElement); - - const char *GetSrcElement() const - { - return m_pszSrcElement; - } - - size_t GetSrcElementLen() const - { - return m_nSrcElementLen; - } - - void SetCondition(const char *pszCondition); - - const char *GetCondition() const - { - return m_pszCondition; - } - - void SetNullable(bool bNullable) - { - m_bNullable = bNullable; - } - - bool IsNullable() const - { - return m_bNullable; - } - - void SetUnique(bool bUnique) - { - m_bUnique = bUnique; - } - - bool IsUnique() const - { - return m_bUnique; - } - - void SetDocumentation(const std::string &osDocumentation) - { - m_osDocumentation = osDocumentation; - } - - const std::string &GetDocumentation() const - { - return m_osDocumentation; - } - - void AnalysePropertyValue(const GMLProperty *psGMLProperty, - bool bSetWidth = true); - - static bool IsSimpleType(GMLPropertyType eType) - { - return eType == GMLPT_String || eType == GMLPT_Integer || - eType == GMLPT_Real; - } -}; - -/************************************************************************/ -/* GMLGeometryPropertyDefn */ -/************************************************************************/ - -class CPL_DLL GMLGeometryPropertyDefn -{ - char *m_pszName = nullptr; - char *m_pszSrcElement = nullptr; - OGRwkbGeometryType m_nGeometryType = wkbUnknown; - const int m_nAttributeIndex = -1; - const bool m_bNullable = true; - bool m_bSRSNameConsistent = true; - std::string m_osSRSName{}; - OGRGeomCoordinatePrecision m_oCoordPrecision{}; - - CPL_DISALLOW_COPY_ASSIGN(GMLGeometryPropertyDefn) - - public: - GMLGeometryPropertyDefn(const char *pszName, const char *pszSrcElement, - OGRwkbGeometryType nType, int nAttributeIndex, - bool bNullable, - const OGRGeomCoordinatePrecision &oCoordPrec = - OGRGeomCoordinatePrecision()); - ~GMLGeometryPropertyDefn(); - - const char *GetName() const - { - return m_pszName; - } - - OGRwkbGeometryType GetType() const - { - return m_nGeometryType; - } - - void SetType(OGRwkbGeometryType nType) - { - m_nGeometryType = nType; - } - - const char *GetSrcElement() const - { - return m_pszSrcElement; - } - - int GetAttributeIndex() const - { - return m_nAttributeIndex; - } - - bool IsNullable() const - { - return m_bNullable; - } - - const OGRGeomCoordinatePrecision &GetCoordinatePrecision() const - { - return m_oCoordPrecision; - } - - void SetSRSName(const std::string &srsName) - { - m_bSRSNameConsistent = true; - m_osSRSName = srsName; - } - - void MergeSRSName(const std::string &osSRSName); - - const std::string &GetSRSName() const - { - return m_osSRSName; - } -}; - -/************************************************************************/ -/* GMLFeatureClass */ -/************************************************************************/ - -class CPL_DLL GMLFeatureClass -{ - char *m_pszName; - char *m_pszElementName; - int n_nNameLen; - int n_nElementNameLen; - int m_nPropertyCount; - GMLPropertyDefn **m_papoProperty; - std::map m_oMapPropertyNameToIndex{}; - std::map m_oMapPropertySrcElementToIndex{}; - - int m_nGeometryPropertyCount; - GMLGeometryPropertyDefn **m_papoGeometryProperty; - - bool m_bSchemaLocked; - - GIntBig m_nFeatureCount; - - char *m_pszExtraInfo; - - bool m_bHaveExtents; - double m_dfXMin; - double m_dfXMax; - double m_dfYMin; - double m_dfYMax; - - char *m_pszSRSName; - bool m_bSRSNameConsistent; - - bool m_bIsConsistentSingleGeomElemPath = true; - std::string m_osSingleGeomElemPath{}; - - CPL_DISALLOW_COPY_ASSIGN(GMLFeatureClass) - - public: - explicit GMLFeatureClass(const char *pszName = ""); - ~GMLFeatureClass(); - - const char *GetElementName() const; - size_t GetElementNameLen() const; - void SetElementName(const char *pszElementName); - - const char *GetName() const - { - return m_pszName; - } - - void SetName(const char *pszNewName); - - int GetPropertyCount() const - { - return m_nPropertyCount; - } - - GMLPropertyDefn *GetProperty(int iIndex) const; - int GetPropertyIndex(const char *pszName) const; - - GMLPropertyDefn *GetProperty(const char *pszName) const - { - return GetProperty(GetPropertyIndex(pszName)); - } - - int GetPropertyIndexBySrcElement(const char *pszElement, int nLen) const; - void StealProperties(); - - int GetGeometryPropertyCount() const - { - return m_nGeometryPropertyCount; - } - - GMLGeometryPropertyDefn *GetGeometryProperty(int iIndex) const; - int GetGeometryPropertyIndexBySrcElement(const char *pszElement) const; - void StealGeometryProperties(); - - bool HasFeatureProperties(); - - int AddProperty(GMLPropertyDefn *, int iPos = -1); - int AddGeometryProperty(GMLGeometryPropertyDefn *); - void ClearGeometryProperties(); - - void SetConsistentSingleGeomElemPath(bool b) - { - m_bIsConsistentSingleGeomElemPath = b; - } - - bool IsConsistentSingleGeomElemPath() const - { - return m_bIsConsistentSingleGeomElemPath; - } - - void SetSingleGeomElemPath(const std::string &s) - { - m_osSingleGeomElemPath = s; - } - - const std::string &GetSingleGeomElemPath() const - { - return m_osSingleGeomElemPath; - } - - bool IsSchemaLocked() const - { - return m_bSchemaLocked; - } - - void SetSchemaLocked(bool bLock) - { - m_bSchemaLocked = bLock; - } - - const char *GetExtraInfo(); - void SetExtraInfo(const char *); - - GIntBig GetFeatureCount(); - void SetFeatureCount(GIntBig); - - bool HasExtents() const - { - return m_bHaveExtents; - } - - void SetExtents(double dfXMin, double dfXMax, double dFYMin, double dfYMax); - bool GetExtents(double *pdfXMin, double *pdfXMax, double *pdFYMin, - double *pdfYMax); - - void SetSRSName(const char *pszSRSName); - void MergeSRSName(const char *pszSRSName); - - const char *GetSRSName() - { - return m_pszSRSName; - } - - CPLXMLNode *SerializeToXML(); - bool InitializeFromXML(CPLXMLNode *); -}; - -/************************************************************************/ -/* GMLFeature */ -/************************************************************************/ - -class CPL_DLL GMLFeature -{ - GMLFeatureClass *m_poClass; - char *m_pszFID; - - int m_nPropertyCount; - GMLProperty *m_pasProperties; - - int m_nGeometryCount; - CPLXMLNode **m_papsGeometry; /* NULL-terminated. Alias to m_apsGeometry if - m_nGeometryCount <= 1 */ - CPLXMLNode *m_apsGeometry[2]; /* NULL-terminated */ - - CPLXMLNode *m_psBoundedByGeometry = nullptr; - - CPL_DISALLOW_COPY_ASSIGN(GMLFeature) - - public: - explicit GMLFeature(GMLFeatureClass *); - ~GMLFeature(); - - GMLFeatureClass *GetClass() const - { - return m_poClass; - } - - void SetGeometryDirectly(CPLXMLNode *psGeom); - void SetGeometryDirectly(int nIdx, CPLXMLNode *psGeom); - void AddGeometry(CPLXMLNode *psGeom); - - int GetGeometryCount() const - { - return m_nGeometryCount; - } - - const CPLXMLNode *const *GetGeometryList() const - { - return m_papsGeometry; - } - - const CPLXMLNode *GetGeometryRef(int nIdx) const; - - void SetBoundedByGeometry(CPLXMLNode *psGeom); - - const CPLXMLNode *GetBoundedByGeometry() const - { - return m_psBoundedByGeometry; - } - - void SetPropertyDirectly(int i, char *pszValue); - - const GMLProperty *GetProperty(int i) const - { - return (i >= 0 && i < m_nPropertyCount) ? &m_pasProperties[i] : nullptr; - } - - const char *GetFID() const - { - return m_pszFID; - } - - void SetFID(const char *pszFID); - - void Dump(FILE *fp); -}; - /************************************************************************/ /* IGMLReader */ /************************************************************************/ @@ -544,7 +111,4 @@ IGMLReader *CreateGMLReader(bool bUseExpatParserPreferably, GMLSwapCoordinatesEnum eSwapCoordinates, bool bGetSecondaryGeometryOption); -OGRFieldType CPL_DLL GML_GetOGRFieldType(GMLPropertyType eType, - OGRFieldSubType &eSubType); - #endif /* GMLREADER_H_INCLUDED */ diff --git a/ogr/ogrsf_frmts/gmlutils/CMakeLists.txt b/ogr/ogrsf_frmts/gmlutils/CMakeLists.txt new file mode 100644 index 000000000000..5f87e38e6fa0 --- /dev/null +++ b/ogr/ogrsf_frmts/gmlutils/CMakeLists.txt @@ -0,0 +1,16 @@ +add_library( + gmlutils OBJECT + gmlfeature.cpp + gmlfeatureclass.cpp + gmlpropertydefn.cpp + gmlutils.cpp + parsexsd.h + parsexsd.cpp + ogrwfsfilter.cpp +) +gdal_standard_includes(gmlutils) +add_dependencies(gmlutils generate_gdal_version_h) +set_property(TARGET gmlutils PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) +target_sources(${GDAL_LIB_TARGET_NAME} PRIVATE $) +target_compile_options(gmlutils PRIVATE ${GDAL_CXX_WARNING_FLAGS} ${WFLAG_OLD_STYLE_CAST} ${WFLAG_EFFCXX}) + diff --git a/ogr/ogrsf_frmts/gml/gmlfeature.cpp b/ogr/ogrsf_frmts/gmlutils/gmlfeature.cpp similarity index 99% rename from ogr/ogrsf_frmts/gml/gmlfeature.cpp rename to ogr/ogrsf_frmts/gmlutils/gmlfeature.cpp index cc12248a6bdb..8eabff33ae69 100644 --- a/ogr/ogrsf_frmts/gml/gmlfeature.cpp +++ b/ogr/ogrsf_frmts/gmlutils/gmlfeature.cpp @@ -28,7 +28,7 @@ ****************************************************************************/ #include "cpl_port.h" -#include "gmlreader.h" +#include "gmlfeature.h" #include diff --git a/ogr/ogrsf_frmts/gmlutils/gmlfeature.h b/ogr/ogrsf_frmts/gmlutils/gmlfeature.h new file mode 100644 index 000000000000..ffa990be5576 --- /dev/null +++ b/ogr/ogrsf_frmts/gmlutils/gmlfeature.h @@ -0,0 +1,464 @@ +/****************************************************************************** + * $Id$ + * + * Project: GML Reader + * Purpose: Public Declarations for OGR free GML Reader code. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2002, Frank Warmerdam + * Copyright (c) 2008-2013, Even Rouault + * + * SPDX-License-Identifier: MIT + ****************************************************************************/ + +#ifndef GMLFEATURE_H_INCLUDED +#define GMLFEATURE_H_INCLUDED + +#include "cpl_port.h" +#include "cpl_vsi.h" +#include "cpl_minixml.h" +#include "ogr_core.h" +#include "ogr_geomcoordinateprecision.h" + +#include +#include + +typedef enum +{ + GMLPT_Untyped = 0, + GMLPT_String = 1, + GMLPT_Integer = 2, + GMLPT_Real = 3, + GMLPT_Complex = 4, + GMLPT_StringList = 5, + GMLPT_IntegerList = 6, + GMLPT_RealList = 7, + GMLPT_FeatureProperty = 8, + GMLPT_FeaturePropertyList = 9, + GMLPT_Boolean = 10, + GMLPT_BooleanList = 11, + GMLPT_Short = 12, + GMLPT_Float = 13, + GMLPT_Integer64 = 14, + GMLPT_Integer64List = 15, + GMLPT_DateTime = 16, + GMLPT_Date = 17, + GMLPT_Time = 18, +} GMLPropertyType; + +/************************************************************************/ +/* GMLPropertyDefn */ +/************************************************************************/ + +typedef struct +{ + int nSubProperties; + char **papszSubProperties; + char *aszSubProperties[2]; /* Optimization in the case of nSubProperties == + 1 */ +} GMLProperty; + +class CPL_DLL GMLPropertyDefn +{ + char *m_pszName = nullptr; + GMLPropertyType m_eType = GMLPT_Untyped; + int m_nWidth = 0; + int m_nPrecision = 0; + char *m_pszSrcElement = nullptr; + size_t m_nSrcElementLen = 0; + char *m_pszCondition = nullptr; + bool m_bNullable = true; + bool m_bUnique = false; + std::string m_osDocumentation{}; + + CPL_DISALLOW_COPY_ASSIGN(GMLPropertyDefn) + + public: + explicit GMLPropertyDefn(const char *pszName, + const char *pszSrcElement = nullptr); + ~GMLPropertyDefn(); + + const char *GetName() const + { + return m_pszName; + } + + GMLPropertyType GetType() const + { + return m_eType; + } + + void SetType(GMLPropertyType eType) + { + m_eType = eType; + } + + void SetWidth(int nWidth) + { + m_nWidth = nWidth; + } + + int GetWidth() const + { + return m_nWidth; + } + + void SetPrecision(int nPrecision) + { + m_nPrecision = nPrecision; + } + + int GetPrecision() const + { + return m_nPrecision; + } + + void SetSrcElement(const char *pszSrcElement); + + const char *GetSrcElement() const + { + return m_pszSrcElement; + } + + size_t GetSrcElementLen() const + { + return m_nSrcElementLen; + } + + void SetCondition(const char *pszCondition); + + const char *GetCondition() const + { + return m_pszCondition; + } + + void SetNullable(bool bNullable) + { + m_bNullable = bNullable; + } + + bool IsNullable() const + { + return m_bNullable; + } + + void SetUnique(bool bUnique) + { + m_bUnique = bUnique; + } + + bool IsUnique() const + { + return m_bUnique; + } + + void SetDocumentation(const std::string &osDocumentation) + { + m_osDocumentation = osDocumentation; + } + + const std::string &GetDocumentation() const + { + return m_osDocumentation; + } + + void AnalysePropertyValue(const GMLProperty *psGMLProperty, + bool bSetWidth = true); + + static bool IsSimpleType(GMLPropertyType eType) + { + return eType == GMLPT_String || eType == GMLPT_Integer || + eType == GMLPT_Real; + } +}; + +/************************************************************************/ +/* GMLGeometryPropertyDefn */ +/************************************************************************/ + +class CPL_DLL GMLGeometryPropertyDefn +{ + char *m_pszName = nullptr; + char *m_pszSrcElement = nullptr; + OGRwkbGeometryType m_nGeometryType = wkbUnknown; + const int m_nAttributeIndex = -1; + const bool m_bNullable = true; + bool m_bSRSNameConsistent = true; + std::string m_osSRSName{}; + OGRGeomCoordinatePrecision m_oCoordPrecision{}; + + CPL_DISALLOW_COPY_ASSIGN(GMLGeometryPropertyDefn) + + public: + GMLGeometryPropertyDefn(const char *pszName, const char *pszSrcElement, + OGRwkbGeometryType nType, int nAttributeIndex, + bool bNullable, + const OGRGeomCoordinatePrecision &oCoordPrec = + OGRGeomCoordinatePrecision()); + ~GMLGeometryPropertyDefn(); + + const char *GetName() const + { + return m_pszName; + } + + OGRwkbGeometryType GetType() const + { + return m_nGeometryType; + } + + void SetType(OGRwkbGeometryType nType) + { + m_nGeometryType = nType; + } + + const char *GetSrcElement() const + { + return m_pszSrcElement; + } + + int GetAttributeIndex() const + { + return m_nAttributeIndex; + } + + bool IsNullable() const + { + return m_bNullable; + } + + const OGRGeomCoordinatePrecision &GetCoordinatePrecision() const + { + return m_oCoordPrecision; + } + + void SetSRSName(const std::string &srsName) + { + m_bSRSNameConsistent = true; + m_osSRSName = srsName; + } + + void MergeSRSName(const std::string &osSRSName); + + const std::string &GetSRSName() const + { + return m_osSRSName; + } +}; + +/************************************************************************/ +/* GMLFeatureClass */ +/************************************************************************/ + +class CPL_DLL GMLFeatureClass +{ + char *m_pszName; + char *m_pszElementName; + int n_nNameLen; + int n_nElementNameLen; + int m_nPropertyCount; + GMLPropertyDefn **m_papoProperty; + std::map m_oMapPropertyNameToIndex{}; + std::map m_oMapPropertySrcElementToIndex{}; + + int m_nGeometryPropertyCount; + GMLGeometryPropertyDefn **m_papoGeometryProperty; + + bool m_bSchemaLocked; + + GIntBig m_nFeatureCount; + + char *m_pszExtraInfo; + + bool m_bHaveExtents; + double m_dfXMin; + double m_dfXMax; + double m_dfYMin; + double m_dfYMax; + + char *m_pszSRSName; + bool m_bSRSNameConsistent; + + bool m_bIsConsistentSingleGeomElemPath = true; + std::string m_osSingleGeomElemPath{}; + + CPL_DISALLOW_COPY_ASSIGN(GMLFeatureClass) + + public: + explicit GMLFeatureClass(const char *pszName = ""); + ~GMLFeatureClass(); + + const char *GetElementName() const; + size_t GetElementNameLen() const; + void SetElementName(const char *pszElementName); + + const char *GetName() const + { + return m_pszName; + } + + void SetName(const char *pszNewName); + + int GetPropertyCount() const + { + return m_nPropertyCount; + } + + GMLPropertyDefn *GetProperty(int iIndex) const; + int GetPropertyIndex(const char *pszName) const; + + GMLPropertyDefn *GetProperty(const char *pszName) const + { + return GetProperty(GetPropertyIndex(pszName)); + } + + int GetPropertyIndexBySrcElement(const char *pszElement, int nLen) const; + void StealProperties(); + + int GetGeometryPropertyCount() const + { + return m_nGeometryPropertyCount; + } + + GMLGeometryPropertyDefn *GetGeometryProperty(int iIndex) const; + int GetGeometryPropertyIndexBySrcElement(const char *pszElement) const; + void StealGeometryProperties(); + + bool HasFeatureProperties(); + + int AddProperty(GMLPropertyDefn *, int iPos = -1); + int AddGeometryProperty(GMLGeometryPropertyDefn *); + void ClearGeometryProperties(); + + void SetConsistentSingleGeomElemPath(bool b) + { + m_bIsConsistentSingleGeomElemPath = b; + } + + bool IsConsistentSingleGeomElemPath() const + { + return m_bIsConsistentSingleGeomElemPath; + } + + void SetSingleGeomElemPath(const std::string &s) + { + m_osSingleGeomElemPath = s; + } + + const std::string &GetSingleGeomElemPath() const + { + return m_osSingleGeomElemPath; + } + + bool IsSchemaLocked() const + { + return m_bSchemaLocked; + } + + void SetSchemaLocked(bool bLock) + { + m_bSchemaLocked = bLock; + } + + const char *GetExtraInfo(); + void SetExtraInfo(const char *); + + GIntBig GetFeatureCount(); + void SetFeatureCount(GIntBig); + + bool HasExtents() const + { + return m_bHaveExtents; + } + + void SetExtents(double dfXMin, double dfXMax, double dFYMin, double dfYMax); + bool GetExtents(double *pdfXMin, double *pdfXMax, double *pdFYMin, + double *pdfYMax); + + void SetSRSName(const char *pszSRSName); + void MergeSRSName(const char *pszSRSName); + + const char *GetSRSName() + { + return m_pszSRSName; + } + + CPLXMLNode *SerializeToXML(); + bool InitializeFromXML(CPLXMLNode *); +}; + +/************************************************************************/ +/* GMLFeature */ +/************************************************************************/ + +class CPL_DLL GMLFeature +{ + GMLFeatureClass *m_poClass; + char *m_pszFID; + + int m_nPropertyCount; + GMLProperty *m_pasProperties; + + int m_nGeometryCount; + CPLXMLNode **m_papsGeometry; /* NULL-terminated. Alias to m_apsGeometry if + m_nGeometryCount <= 1 */ + CPLXMLNode *m_apsGeometry[2]; /* NULL-terminated */ + + CPLXMLNode *m_psBoundedByGeometry = nullptr; + + CPL_DISALLOW_COPY_ASSIGN(GMLFeature) + + public: + explicit GMLFeature(GMLFeatureClass *); + ~GMLFeature(); + + GMLFeatureClass *GetClass() const + { + return m_poClass; + } + + void SetGeometryDirectly(CPLXMLNode *psGeom); + void SetGeometryDirectly(int nIdx, CPLXMLNode *psGeom); + void AddGeometry(CPLXMLNode *psGeom); + + int GetGeometryCount() const + { + return m_nGeometryCount; + } + + const CPLXMLNode *const *GetGeometryList() const + { + return m_papsGeometry; + } + + const CPLXMLNode *GetGeometryRef(int nIdx) const; + + void SetBoundedByGeometry(CPLXMLNode *psGeom); + + const CPLXMLNode *GetBoundedByGeometry() const + { + return m_psBoundedByGeometry; + } + + void SetPropertyDirectly(int i, char *pszValue); + + const GMLProperty *GetProperty(int i) const + { + return (i >= 0 && i < m_nPropertyCount) ? &m_pasProperties[i] : nullptr; + } + + const char *GetFID() const + { + return m_pszFID; + } + + void SetFID(const char *pszFID); + + void Dump(FILE *fp); +}; + +OGRFieldType CPL_DLL GML_GetOGRFieldType(GMLPropertyType eType, + OGRFieldSubType &eSubType); + +#endif diff --git a/ogr/ogrsf_frmts/gml/gmlfeatureclass.cpp b/ogr/ogrsf_frmts/gmlutils/gmlfeatureclass.cpp similarity index 99% rename from ogr/ogrsf_frmts/gml/gmlfeatureclass.cpp rename to ogr/ogrsf_frmts/gmlutils/gmlfeatureclass.cpp index 86871ce29e30..7e7a199da824 100644 --- a/ogr/ogrsf_frmts/gml/gmlfeatureclass.cpp +++ b/ogr/ogrsf_frmts/gmlutils/gmlfeatureclass.cpp @@ -28,7 +28,7 @@ ****************************************************************************/ #include "cpl_port.h" -#include "gmlreader.h" +#include "gmlfeature.h" #include #include diff --git a/ogr/ogrsf_frmts/gml/gmlpropertydefn.cpp b/ogr/ogrsf_frmts/gmlutils/gmlpropertydefn.cpp similarity index 99% rename from ogr/ogrsf_frmts/gml/gmlpropertydefn.cpp rename to ogr/ogrsf_frmts/gmlutils/gmlpropertydefn.cpp index 622359e99fbc..9eb93da06bdf 100644 --- a/ogr/ogrsf_frmts/gml/gmlpropertydefn.cpp +++ b/ogr/ogrsf_frmts/gmlutils/gmlpropertydefn.cpp @@ -28,7 +28,7 @@ ****************************************************************************/ #include "cpl_port.h" -#include "gmlreader.h" +#include "gmlfeature.h" #include diff --git a/ogr/ogrsf_frmts/gml/gmlutils.cpp b/ogr/ogrsf_frmts/gmlutils/gmlutils.cpp similarity index 100% rename from ogr/ogrsf_frmts/gml/gmlutils.cpp rename to ogr/ogrsf_frmts/gmlutils/gmlutils.cpp diff --git a/ogr/ogrsf_frmts/gml/gmlutils.h b/ogr/ogrsf_frmts/gmlutils/gmlutils.h similarity index 82% rename from ogr/ogrsf_frmts/gml/gmlutils.h rename to ogr/ogrsf_frmts/gmlutils/gmlutils.h index 04de1deef375..329af13c3232 100644 --- a/ogr/ogrsf_frmts/gml/gmlutils.h +++ b/ogr/ogrsf_frmts/gmlutils/gmlutils.h @@ -50,24 +50,25 @@ typedef enum SRSNAME_OGC_URL } OGRGMLSRSNameFormat; -const char * +const char CPL_DLL * GML_ExtractSrsNameFromGeometry(const CPLXMLNode *const *papsGeometry, std::string &osWork, bool bConsiderEPSGAsURN); -bool GML_IsSRSLatLongOrder(const char *pszSRSName); -bool GML_IsLegitSRSName(const char *pszSRSName); +bool CPL_DLL GML_IsSRSLatLongOrder(const char *pszSRSName); +bool CPL_DLL GML_IsLegitSRSName(const char *pszSRSName); -void *GML_BuildOGRGeometryFromList_CreateCache(); -void GML_BuildOGRGeometryFromList_DestroyCache(void *hCacheSRS); +void CPL_DLL *GML_BuildOGRGeometryFromList_CreateCache(); +void CPL_DLL GML_BuildOGRGeometryFromList_DestroyCache(void *hCacheSRS); -OGRGeometry *GML_BuildOGRGeometryFromList( +OGRGeometry CPL_DLL *GML_BuildOGRGeometryFromList( const CPLXMLNode *const *papsGeometry, bool bTryToMakeMultipolygons, bool bInvertAxisOrderIfLatLong, const char *pszDefaultSRSName, bool bConsiderEPSGAsURN, GMLSwapCoordinatesEnum eSwapCoordinates, int nPseudoBoolGetSecondaryGeometryOption, void *hCacheSRS, bool bFaceHoleNegative = false); -char *GML_GetSRSName(const OGRSpatialReference *poSRS, - OGRGMLSRSNameFormat eSRSNameFormat, bool *pbCoordSwap); +char CPL_DLL *GML_GetSRSName(const OGRSpatialReference *poSRS, + OGRGMLSRSNameFormat eSRSNameFormat, + bool *pbCoordSwap); #endif /* _CPL_GMLREADERP_H_INCLUDED */ diff --git a/ogr/ogrsf_frmts/wfs/ogrwfsfilter.cpp b/ogr/ogrsf_frmts/gmlutils/ogrwfsfilter.cpp similarity index 98% rename from ogr/ogrsf_frmts/wfs/ogrwfsfilter.cpp rename to ogr/ogrsf_frmts/gmlutils/ogrwfsfilter.cpp index 7a794afbd6aa..f8f7f3477f46 100644 --- a/ogr/ogrsf_frmts/wfs/ogrwfsfilter.cpp +++ b/ogr/ogrsf_frmts/gmlutils/ogrwfsfilter.cpp @@ -26,7 +26,7 @@ * DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "ogr_wfs.h" +#include "ogrwfsfilter.h" #include "ogr_p.h" typedef struct @@ -154,13 +154,12 @@ static const char *WFS_ExprGetSRSName(const swq_expr_node *poExpr, else if (poExpr->nSubExprCount == iSubArgIndex + 1 && poExpr->papoSubExpr[iSubArgIndex]->field_type == SWQ_INTEGER) { - if (oSRS.importFromEPSGA( - (int)poExpr->papoSubExpr[iSubArgIndex]->int_value) == - OGRERR_NONE) + if (oSRS.importFromEPSGA(static_cast( + poExpr->papoSubExpr[iSubArgIndex]->int_value)) == OGRERR_NONE) { return CPLSPrintf( "urn:ogc:def:crs:EPSG::%d", - (int)poExpr->papoSubExpr[iSubArgIndex]->int_value); + static_cast(poExpr->papoSubExpr[iSubArgIndex]->int_value)); } } else if (poExpr->nSubExprCount == iSubArgIndex && @@ -522,7 +521,8 @@ static bool WFS_ExprDumpAsOGCFilter(CPLString &osFilter, papszOptions = CSLSetNameValue(papszOptions, "GMLID", CPLSPrintf("id%d", psOptions->nUniqueGeomGMLId++)); - char *pszGML = OGR_G_ExportToGMLEx((OGRGeometryH)poGeom, papszOptions); + char *pszGML = + OGR_G_ExportToGMLEx(OGRGeometry::ToHandle(poGeom), papszOptions); osFilter += pszGML; CSLDestroy(papszOptions); delete poGeom; @@ -690,8 +690,8 @@ static bool OGRWFSCheckSRIDArg(swq_expr_node *op, int iSubArgIndex) if (op->papoSubExpr[iSubArgIndex]->field_type == SWQ_INTEGER) { OGRSpatialReference oSRS; - if (oSRS.importFromEPSGA( - (int)op->papoSubExpr[iSubArgIndex]->int_value) != OGRERR_NONE) + if (oSRS.importFromEPSGA(static_cast( + op->papoSubExpr[iSubArgIndex]->int_value)) != OGRERR_NONE) { CPLError(CE_Failure, CPLE_AppDefined, "Wrong value for argument %d of %s", iSubArgIndex + 1, @@ -885,11 +885,10 @@ static const swq_operation OGRWFSSpatialOps[] = { const swq_operation *OGRWFSCustomFuncRegistrar::GetOperator(const char *pszName) { - for (int i = 0; - i < (int)(sizeof(OGRWFSSpatialOps) / sizeof(OGRWFSSpatialOps[0])); i++) + for (const auto &op : OGRWFSSpatialOps) { - if (EQUAL(OGRWFSSpatialOps[i].pszName, pszName)) - return &OGRWFSSpatialOps[i]; + if (EQUAL(op.pszName, pszName)) + return &op; } return nullptr; } diff --git a/ogr/ogrsf_frmts/gmlutils/ogrwfsfilter.h b/ogr/ogrsf_frmts/gmlutils/ogrwfsfilter.h new file mode 100644 index 000000000000..84120004bedb --- /dev/null +++ b/ogr/ogrsf_frmts/gmlutils/ogrwfsfilter.h @@ -0,0 +1,29 @@ +/****************************************************************************** + * Project: WFS Reader + * Purpose: WFS filtering + * Purpose: Implements OGR SQL into OGC Filter translation. + * Author: Even Rouault, + * + ****************************************************************************** + * Copyright (c) 2010-2012, Even Rouault + * + * SPDX-License-Identifier: MIT + ****************************************************************************/ + +#ifndef OGRWFSFILTER_H_INCLUDED +#define OGRWFSFILTER_H_INCLUDED + +#include "cpl_string.h" +#include "gdal_priv.h" +#include "ogr_feature.h" +#include "ogrsf_frmts.h" +#include "ogr_swq.h" + +CPLString CPL_DLL WFS_TurnSQLFilterToOGCFilter( + const swq_expr_node *poExpr, GDALDataset *poDS, OGRFeatureDefn *poFDefn, + int nVersion, int bPropertyIsNotEqualToSupported, int bUseFeatureId, + int bGmlObjectIdNeedsGMLPrefix, const char *pszNSPrefix, + int *pbOutNeedsNullCheck); +swq_custom_func_registrar CPL_DLL *WFSGetCustomFuncRegistrar(); + +#endif diff --git a/ogr/ogrsf_frmts/gml/parsexsd.cpp b/ogr/ogrsf_frmts/gmlutils/parsexsd.cpp similarity index 100% rename from ogr/ogrsf_frmts/gml/parsexsd.cpp rename to ogr/ogrsf_frmts/gmlutils/parsexsd.cpp diff --git a/ogr/ogrsf_frmts/gml/parsexsd.h b/ogr/ogrsf_frmts/gmlutils/parsexsd.h similarity index 98% rename from ogr/ogrsf_frmts/gml/parsexsd.h rename to ogr/ogrsf_frmts/gmlutils/parsexsd.h index 02f4582907ea..a4a97933639b 100644 --- a/ogr/ogrsf_frmts/gml/parsexsd.h +++ b/ogr/ogrsf_frmts/gmlutils/parsexsd.h @@ -34,7 +34,7 @@ #include "cpl_port.h" #include -#include "gmlreader.h" +#include "gmlfeature.h" bool CPL_DLL GMLParseXSD(const char *pszFile, bool bUseSchemaImports, std::vector &aosClasses, diff --git a/ogr/ogrsf_frmts/nas/CMakeLists.txt b/ogr/ogrsf_frmts/nas/CMakeLists.txt index c47dd844ee71..7386ce5a0f37 100644 --- a/ogr/ogrsf_frmts/nas/CMakeLists.txt +++ b/ogr/ogrsf_frmts/nas/CMakeLists.txt @@ -9,7 +9,7 @@ add_gdal_driver( ogrnaslayer.cpp BUILTIN) # BUILTIN because of GML dependency gdal_standard_includes(ogr_NAS) -target_include_directories(ogr_NAS PRIVATE $) +target_include_directories(ogr_NAS PRIVATE $ $) if (GDAL_USE_EXPAT) target_compile_definitions(ogr_NAS PRIVATE -DHAVE_EXPAT) gdal_target_link_libraries(ogr_NAS PRIVATE ${EXPAT_TARGET}) diff --git a/ogr/ogrsf_frmts/wfs/CMakeLists.txt b/ogr/ogrsf_frmts/wfs/CMakeLists.txt index b0d0e59426df..a437f6f34927 100644 --- a/ogr/ogrsf_frmts/wfs/CMakeLists.txt +++ b/ogr/ogrsf_frmts/wfs/CMakeLists.txt @@ -3,10 +3,10 @@ add_gdal_driver( SOURCES ogr_wfs.h ogrwfsdatasource.cpp ogrwfsdriver.cpp - ogrwfsfilter.cpp ogrwfsjoinlayer.cpp ogrwfslayer.cpp ogroapifdriver.cpp - BUILTIN) + PLUGIN_CAPABLE + NO_DEPS) gdal_standard_includes(ogr_WFS) -target_include_directories(ogr_WFS PRIVATE $) +target_include_directories(ogr_WFS PRIVATE $) diff --git a/ogr/ogrsf_frmts/wfs/ogr_wfs.h b/ogr/ogrsf_frmts/wfs/ogr_wfs.h index 1098f753fcb2..2c4b6dd313a4 100644 --- a/ogr/ogrsf_frmts/wfs/ogr_wfs.h +++ b/ogr/ogrsf_frmts/wfs/ogr_wfs.h @@ -36,20 +36,12 @@ #include "cpl_minixml.h" #include "ogrsf_frmts.h" -#include "gmlreader.h" +#include "gmlfeature.h" #include "cpl_http.h" #include "ogr_swq.h" const CPLXMLNode *WFSFindNode(const CPLXMLNode *psXML, const char *pszRootName); -CPLString -WFS_TurnSQLFilterToOGCFilter(const swq_expr_node *poExpr, GDALDataset *poDS, - OGRFeatureDefn *poFDefn, int nVersion, - int bPropertyIsNotEqualToSupported, - int bUseFeatureId, int bGmlObjectIdNeedsGMLPrefix, - const char *pszNSPrefix, int *pbOutNeedsNullCheck); -swq_custom_func_registrar *WFSGetCustomFuncRegistrar(); - const char *FindSubStringInsensitive(const char *pszStr, const char *pszSubStr); CPLString WFS_EscapeURL(const char *pszURL); diff --git a/ogr/ogrsf_frmts/wfs/ogrwfsdatasource.cpp b/ogr/ogrsf_frmts/wfs/ogrwfsdatasource.cpp index 889c76a36879..0cc3b2dc0a1d 100644 --- a/ogr/ogrsf_frmts/wfs/ogrwfsdatasource.cpp +++ b/ogr/ogrsf_frmts/wfs/ogrwfsdatasource.cpp @@ -35,6 +35,7 @@ #include "parsexsd.h" #include "ogr_swq.h" #include "ogr_p.h" +#include "ogrwfsfilter.h" #include diff --git a/ogr/ogrsf_frmts/wfs/ogrwfsjoinlayer.cpp b/ogr/ogrsf_frmts/wfs/ogrwfsjoinlayer.cpp index e9d09819a528..515a150087ad 100644 --- a/ogr/ogrsf_frmts/wfs/ogrwfsjoinlayer.cpp +++ b/ogr/ogrsf_frmts/wfs/ogrwfsjoinlayer.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ #include "ogr_wfs.h" +#include "ogrwfsfilter.h" #include "cpl_md5.h" /************************************************************************/ diff --git a/ogr/ogrsf_frmts/wfs/ogrwfslayer.cpp b/ogr/ogrsf_frmts/wfs/ogrwfslayer.cpp index 5773e38c75e3..f38ea61f4637 100644 --- a/ogr/ogrsf_frmts/wfs/ogrwfslayer.cpp +++ b/ogr/ogrsf_frmts/wfs/ogrwfslayer.cpp @@ -32,6 +32,7 @@ #include "cpl_minixml.h" #include "cpl_http.h" #include "parsexsd.h" +#include "ogrwfsfilter.h" /************************************************************************/ /* OGRWFSLayer() */