Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Boolean subtype for OGR Output (#6803)
* Set Boolean subtype * Convert true and false to 1 and 0 and add msautotest * Update mapogroutput.cpp Co-authored-by: Even Rouault <even.rouault@spatialys.com> * Update mapogroutput.cpp Co-authored-by: Even Rouault <even.rouault@spatialys.com> * Update mapogroutput.cpp Co-authored-by: Even Rouault <even.rouault@spatialys.com> * Update mapogroutput.cpp Co-authored-by: Even Rouault <even.rouault@spatialys.com> * Use new variable for comparison * Use Boolean field types when reading OGR data sources * Add geopackage tests * Add test dataset Co-authored-by: Even Rouault <even.rouault@spatialys.com>
- Loading branch information
1 parent
67123c6
commit 3328055
Showing
13 changed files
with
455 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Content-Type: text/xml; charset=UTF-8 | ||
|
||
<?xml version='1.0' encoding="UTF-8" ?> | ||
<schema | ||
targetNamespace="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:ms="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:ogc="http://www.opengis.net/ogc" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
xmlns="http://www.w3.org/2001/XMLSchema" | ||
xmlns:gml="http://www.opengis.net/gml" | ||
elementFormDefault="qualified" version="0.1" > | ||
|
||
<import namespace="http://www.opengis.net/gml" | ||
schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd" /> | ||
|
||
<element name="autotypes" | ||
type="ms:autotypesType" | ||
substitutionGroup="gml:_Feature" /> | ||
|
||
<complexType name="autotypesType"> | ||
<complexContent> | ||
<extension base="gml:AbstractFeatureType"> | ||
<sequence> | ||
<element name="msGeometry" type="gml:GeometryPropertyType" minOccurs="0" maxOccurs="1"/> | ||
<element name="mychar" minOccurs="0" type="string"/> | ||
<element name="myvarchar" minOccurs="0" type="string"/> | ||
<element name="mytext" minOccurs="0" type="string"/> | ||
<element name="mybool" minOccurs="0" type="boolean"/> | ||
<element name="myint2" minOccurs="0" type="integer"/> | ||
<element name="myint4" minOccurs="0" type="integer"/> | ||
<element name="myint8" minOccurs="0" type="long"/> | ||
<element name="myfloat4" minOccurs="0" type="double"/> | ||
<element name="myfloat8" minOccurs="0" type="double"/> | ||
<element name="mynumeric" minOccurs="0" type="double"/> | ||
<element name="mydate" minOccurs="0" type="date"/> | ||
<element name="mytime" minOccurs="0" type="string"/> | ||
<element name="mytimez" minOccurs="0" type="string"/> | ||
<element name="mytimestamp" minOccurs="0" type="dateTime"/> | ||
<element name="mytimestampz" minOccurs="0" type="dateTime"/> | ||
</sequence> | ||
</extension> | ||
</complexContent> | ||
</complexType> | ||
|
||
</schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Content-Type: text/xml; subtype=gml/3.1.1; charset=UTF-8 | ||
|
||
<?xml version='1.0' encoding="UTF-8" ?> | ||
<schema | ||
targetNamespace="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:ms="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:ogc="http://www.opengis.net/ogc" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
xmlns="http://www.w3.org/2001/XMLSchema" | ||
xmlns:gml="http://www.opengis.net/gml" | ||
elementFormDefault="qualified" version="0.1" > | ||
|
||
<import namespace="http://www.opengis.net/gml" | ||
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd" /> | ||
|
||
<element name="autotypes" | ||
type="ms:autotypesType" | ||
substitutionGroup="gml:_Feature" /> | ||
|
||
<complexType name="autotypesType"> | ||
<complexContent> | ||
<extension base="gml:AbstractFeatureType"> | ||
<sequence> | ||
<element name="msGeometry" type="gml:GeometryPropertyType" minOccurs="0" maxOccurs="1"/> | ||
<element name="mychar" minOccurs="0" type="string"/> | ||
<element name="myvarchar" minOccurs="0" type="string"/> | ||
<element name="mytext" minOccurs="0" type="string"/> | ||
<element name="mybool" minOccurs="0" type="boolean"/> | ||
<element name="myint2" minOccurs="0" type="integer"/> | ||
<element name="myint4" minOccurs="0" type="integer"/> | ||
<element name="myint8" minOccurs="0" type="long"/> | ||
<element name="myfloat4" minOccurs="0" type="double"/> | ||
<element name="myfloat8" minOccurs="0" type="double"/> | ||
<element name="mynumeric" minOccurs="0" type="double"/> | ||
<element name="mydate" minOccurs="0" type="date"/> | ||
<element name="mytime" minOccurs="0" type="string"/> | ||
<element name="mytimez" minOccurs="0" type="string"/> | ||
<element name="mytimestamp" minOccurs="0" type="dateTime"/> | ||
<element name="mytimestampz" minOccurs="0" type="dateTime"/> | ||
</sequence> | ||
</extension> | ||
</complexContent> | ||
</complexType> | ||
|
||
</schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Content-Type: application/gml+xml; version=3.2; charset=UTF-8 | ||
|
||
<?xml version='1.0' encoding="UTF-8" ?> | ||
<schema | ||
targetNamespace="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:ms="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
xmlns="http://www.w3.org/2001/XMLSchema" | ||
xmlns:gml="http://www.opengis.net/gml/3.2" | ||
elementFormDefault="qualified" version="0.1" > | ||
|
||
<import namespace="http://www.opengis.net/gml/3.2" | ||
schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd" /> | ||
|
||
<element name="autotypes" | ||
type="ms:autotypesType" | ||
substitutionGroup="gml:AbstractFeature" /> | ||
|
||
<complexType name="autotypesType"> | ||
<complexContent> | ||
<extension base="gml:AbstractFeatureType"> | ||
<sequence> | ||
<element name="msGeometry" type="gml:GeometryPropertyType" minOccurs="0" maxOccurs="1"/> | ||
<element name="mychar" minOccurs="0" type="string"/> | ||
<element name="myvarchar" minOccurs="0" type="string"/> | ||
<element name="mytext" minOccurs="0" type="string"/> | ||
<element name="mybool" minOccurs="0" type="boolean"/> | ||
<element name="myint2" minOccurs="0" type="integer"/> | ||
<element name="myint4" minOccurs="0" type="integer"/> | ||
<element name="myint8" minOccurs="0" type="long"/> | ||
<element name="myfloat4" minOccurs="0" type="double"/> | ||
<element name="myfloat8" minOccurs="0" type="double"/> | ||
<element name="mynumeric" minOccurs="0" type="double"/> | ||
<element name="mydate" minOccurs="0" type="gml:TimeInstantType"/> | ||
<element name="mytime" minOccurs="0" type="string"/> | ||
<element name="mytimez" minOccurs="0" type="string"/> | ||
<element name="mytimestamp" minOccurs="0" type="gml:TimeInstantType"/> | ||
<element name="mytimestampz" minOccurs="0" type="gml:TimeInstantType"/> | ||
</sequence> | ||
</extension> | ||
</complexContent> | ||
</complexType> | ||
|
||
</schema> |
48 changes: 48 additions & 0 deletions
48
msautotest/wxs/expected/wfs_getfeaturetypes10_geopackage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Content-Type: text/xml; charset=UTF-8 | ||
|
||
<?xml version='1.0' encoding="UTF-8" ?> | ||
<wfs:FeatureCollection | ||
xmlns:ms="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:wfs="http://www.opengis.net/wfs" | ||
xmlns:gml="http://www.opengis.net/gml" | ||
xmlns:ogc="http://www.opengis.net/ogc" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd | ||
http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?myparam=something&SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=autotypes&OUTPUTFORMAT=XMLSCHEMA"> | ||
<gml:boundedBy> | ||
<gml:Box srsName="EPSG:4326"> | ||
<gml:coordinates>1.000000,2.000000 1.000000,2.000000</gml:coordinates> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
<!-- WARNING: FeatureId item 'id' not found in typename 'autotypes'. --> | ||
<gml:featureMember> | ||
<ms:autotypes> | ||
<gml:boundedBy> | ||
<gml:Box srsName="EPSG:4326"> | ||
<gml:coordinates>1.000000,2.000000 1.000000,2.000000</gml:coordinates> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
<ms:msGeometry> | ||
<gml:Point srsName="EPSG:4326"> | ||
<gml:coordinates>1.000000,2.000000</gml:coordinates> | ||
</gml:Point> | ||
</ms:msGeometry> | ||
<ms:mychar>abc </ms:mychar> | ||
<ms:myvarchar>def</ms:myvarchar> | ||
<ms:mytext>ghi</ms:mytext> | ||
<ms:mybool>1</ms:mybool> | ||
<ms:myint2>10</ms:myint2> | ||
<ms:myint4>100</ms:myint4> | ||
<ms:myint8>1000</ms:myint8> | ||
<ms:myfloat4>1.5</ms:myfloat4> | ||
<ms:myfloat8>2.5</ms:myfloat8> | ||
<ms:mynumeric>3.33</ms:mynumeric> | ||
<ms:mydate>2023-01-01</ms:mydate> | ||
<ms:mytime>00:00:00</ms:mytime> | ||
<ms:mytimez>00:00:00</ms:mytimez> | ||
<ms:mytimestamp>2023-01-01T00:00:00Z</ms:mytimestamp> | ||
<ms:mytimestampz>2023-01-01T00:00:00Z</ms:mytimestampz> | ||
</ms:autotypes> | ||
</gml:featureMember> | ||
</wfs:FeatureCollection> | ||
|
49 changes: 49 additions & 0 deletions
49
msautotest/wxs/expected/wfs_getfeaturetypes11_geopackage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Content-Type: text/xml; subtype=gml/3.1.1; charset=UTF-8 | ||
|
||
<?xml version='1.0' encoding="UTF-8" ?> | ||
<wfs:FeatureCollection | ||
xmlns:ms="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:gml="http://www.opengis.net/gml" | ||
xmlns:wfs="http://www.opengis.net/wfs" | ||
xmlns:ogc="http://www.opengis.net/ogc" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?myparam=something&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=autotypes&OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="EPSG:4326"> | ||
<gml:lowerCorner>2.000000 1.000000</gml:lowerCorner> | ||
<gml:upperCorner>2.000000 1.000000</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<!-- WARNING: FeatureId item 'id' not found in typename 'autotypes'. --> | ||
<gml:featureMember> | ||
<ms:autotypes> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="EPSG:4326"> | ||
<gml:lowerCorner>2.000000 1.000000</gml:lowerCorner> | ||
<gml:upperCorner>2.000000 1.000000</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<ms:msGeometry> | ||
<gml:Point srsName="EPSG:4326"> | ||
<gml:pos>2.000000 1.000000</gml:pos> | ||
</gml:Point> | ||
</ms:msGeometry> | ||
<ms:mychar>abc </ms:mychar> | ||
<ms:myvarchar>def</ms:myvarchar> | ||
<ms:mytext>ghi</ms:mytext> | ||
<ms:mybool>1</ms:mybool> | ||
<ms:myint2>10</ms:myint2> | ||
<ms:myint4>100</ms:myint4> | ||
<ms:myint8>1000</ms:myint8> | ||
<ms:myfloat4>1.5</ms:myfloat4> | ||
<ms:myfloat8>2.5</ms:myfloat8> | ||
<ms:mynumeric>3.33</ms:mynumeric> | ||
<ms:mydate>2023-01-01</ms:mydate> | ||
<ms:mytime>00:00:00</ms:mytime> | ||
<ms:mytimez>00:00:00</ms:mytimez> | ||
<ms:mytimestamp>2023-01-01T00:00:00Z</ms:mytimestamp> | ||
<ms:mytimestampz>2023-01-01T00:00:00Z</ms:mytimestampz> | ||
</ms:autotypes> | ||
</gml:featureMember> | ||
</wfs:FeatureCollection> | ||
|
11 changes: 11 additions & 0 deletions
11
msautotest/wxs/expected/wfs_getfeaturetypes20_booleans_postgis.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Content-Disposition: attachment; filename=result.dat | ||
Content-Type: application/json | ||
|
||
{ | ||
"type": "FeatureCollection", | ||
"numberMatched": 1, | ||
"name": "booleans", | ||
"features": [ | ||
{ "type": "Feature", "properties": { "id": 1, "my_bool_true": true, "my_bool_false": false }, "geometry": { "type": "Point", "coordinates": [ 1.0, 2.0 ] } } | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
msautotest/wxs/expected/wfs_getfeaturetypes20_geopackage.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Content-Disposition: attachment; filename=result.dat | ||
Content-Type: application/json | ||
|
||
{ | ||
"type": "FeatureCollection", | ||
"numberMatched": 1, | ||
"name": "autotypes", | ||
"features": [ | ||
{ "type": "Feature", "properties": { "mychar": "abc ", "myvarchar": "def", "mytext": "ghi", "mybool": true, "myint2": 10, "myint4": 100, "myint8": 1000, "myfloat4": 1.5, "myfloat8": 2.5, "mynumeric": 3.33, "mydate": "2023-01-01", "mytime": "00:00:00", "mytimez": "00:00:00", "mytimestamp": "2023-01-01T00:00:00", "mytimestampz": "2023-01-01T00:00:00Z" }, "geometry": { "type": "Point", "coordinates": [ 1.0, 2.0 ] } } | ||
] | ||
} |
49 changes: 49 additions & 0 deletions
49
msautotest/wxs/expected/wfs_getfeaturetypes20_geopackage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Content-Type: text/xml; subtype="gml/3.2.1"; charset=UTF-8 | ||
|
||
<?xml version='1.0' encoding="UTF-8" ?> | ||
<wfs:FeatureCollection | ||
xmlns:ms="http://mapserver.gis.umn.edu/mapserver" | ||
xmlns:gml="http://www.opengis.net/gml/3.2" | ||
xmlns:wfs="http://www.opengis.net/wfs/2.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?myparam=something&SERVICE=WFS&VERSION=2.0.0&REQUEST=DescribeFeatureType&TYPENAME=autotypes&OUTPUTFORMAT=application%2Fgml%2Bxml%3B%20version%3D3.2 http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd" | ||
timeStamp="" numberMatched="1" numberReturned="1"> | ||
<wfs:boundedBy> | ||
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"> | ||
<gml:lowerCorner>2.000000 1.000000</gml:lowerCorner> | ||
<gml:upperCorner>2.000000 1.000000</gml:upperCorner> | ||
</gml:Envelope> | ||
</wfs:boundedBy> | ||
<!-- WARNING: FeatureId item 'id' not found in typename 'autotypes'. --> | ||
<wfs:member> | ||
<ms:autotypes> | ||
<gml:boundedBy> | ||
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"> | ||
<gml:lowerCorner>2.000000 1.000000</gml:lowerCorner> | ||
<gml:upperCorner>2.000000 1.000000</gml:upperCorner> | ||
</gml:Envelope> | ||
</gml:boundedBy> | ||
<ms:msGeometry> | ||
<gml:Point gml:id=".1" srsName="urn:ogc:def:crs:EPSG::4326"> | ||
<gml:pos>2.000000 1.000000</gml:pos> | ||
</gml:Point> | ||
</ms:msGeometry> | ||
<ms:mychar>abc </ms:mychar> | ||
<ms:myvarchar>def</ms:myvarchar> | ||
<ms:mytext>ghi</ms:mytext> | ||
<ms:mybool>1</ms:mybool> | ||
<ms:myint2>10</ms:myint2> | ||
<ms:myint4>100</ms:myint4> | ||
<ms:myint8>1000</ms:myint8> | ||
<ms:myfloat4>1.5</ms:myfloat4> | ||
<ms:myfloat8>2.5</ms:myfloat8> | ||
<ms:mynumeric>3.33</ms:mynumeric> | ||
<ms:mydate gml:id=".mydate"><gml:timePosition>2023-01-01</gml:timePosition></ms:mydate> | ||
<ms:mytime>00:00:00</ms:mytime> | ||
<ms:mytimez>00:00:00</ms:mytimez> | ||
<ms:mytimestamp gml:id=".mytimestamp"><gml:timePosition>2023-01-01T00:00:00Z</gml:timePosition></ms:mytimestamp> | ||
<ms:mytimestampz gml:id=".mytimestampz"><gml:timePosition>2023-01-01T00:00:00Z</gml:timePosition></ms:mytimestampz> | ||
</ms:autotypes> | ||
</wfs:member> | ||
</wfs:FeatureCollection> | ||
|
Oops, something went wrong.