Skip to content
Permalink
Browse files

Fix oriented minimum bounding box algorithm

  • Loading branch information
github-actions authored and nyalldawson committed Feb 6, 2020
1 parent 6609651 commit 7f00a40424cf4f7940f3b260f194e57a804d00ad

This file was deleted.

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xsi:schemaLocation="http://ogr.maptools.org/ mbg_rect_field.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-2.056603773584904</gml:X><gml:Y>-3</gml:Y></gml:coord>
<gml:coord><gml:X>9.162955854126681</gml:X><gml:Y>6.088675623800386</gml:Y></gml:coord>
<gml:coord><gml:X>9.162955854126682</gml:X><gml:Y>6.489909219550769</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

@@ -25,26 +25,26 @@
</gml:featureMember>
<gml:featureMember>
<ogr:mbg_rect_field fid="mbg_rect_field.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.24145873320538,-0.054510556621882 5.24145873320538,-1.05451055662188 7.24145873320538,-1.05451055662188 7.24145873320538,-0.054510556621882 5.24145873320538,-0.054510556621882</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.24145873320538,-1.05451055662188 6.24145873320538,-2.05451055662188 7.24145873320538,-1.05451055662188 6.24145873320538,-0.054510556621882 5.24145873320538,-1.05451055662188</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>1</ogr:id>
<ogr:name>dd</ogr:name>
<ogr:width>1.000000</ogr:width>
<ogr:height>2.000000</ogr:height>
<ogr:angle>90.000000</ogr:angle>
<ogr:width>1.414214</ogr:width>
<ogr:height>1.414214</ogr:height>
<ogr:angle>45.000000</ogr:angle>
<ogr:area>2.000000</ogr:area>
<ogr:perimeter>6.000000</ogr:perimeter>
<ogr:perimeter>5.656854</ogr:perimeter>
</ogr:mbg_rect_field>
</gml:featureMember>
<gml:featureMember>
<ogr:mbg_rect_field fid="mbg_rect_field.2">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.0,6.08867562380039 2.0,4.4236084452975 5.1725527831094,4.4236084452975 5.1725527831094,6.08867562380039 2.0,6.08867562380039</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.34748915030878,4.7278689643513 5.06593031585745,6.48990921955077 1.84418704183259,5.97510243323637 2.12574587628392,4.2130621780369 5.34748915030878,4.7278689643513</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>2</ogr:id>
<ogr:name>bb</ogr:name>
<ogr:width>1.665067</ogr:width>
<ogr:height>3.172553</ogr:height>
<ogr:angle>90.000000</ogr:angle>
<ogr:area>5.282514</ogr:area>
<ogr:perimeter>9.675240</ogr:perimeter>
<ogr:width>1.784394</ogr:width>
<ogr:height>3.262615</ogr:height>
<ogr:angle>80.921378</ogr:angle>
<ogr:area>5.821790</ogr:area>
<ogr:perimeter>10.094017</ogr:perimeter>
</ogr:mbg_rect_field>
</gml:featureMember>
<gml:featureMember>
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="mbg_rect_field" type="ogr:mbg_rect_field_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="mbg_rect_field_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="name" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="width" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="21"/>
<xs:fractionDigits value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="height" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="21"/>
<xs:fractionDigits value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="angle" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="21"/>
<xs:fractionDigits value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="area" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="21"/>
<xs:fractionDigits value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="perimeter" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="21"/>
<xs:fractionDigits value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

This file was deleted.

@@ -1,21 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xsi:schemaLocation="http://ogr.maptools.org/ oriented_bounds.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-1</gml:X><gml:Y>-3.270344827586206</gml:Y></gml:coord>
<gml:coord><gml:X>10.04413793103448</gml:X><gml:Y>6.441176470588236</gml:Y></gml:coord>
<gml:coord><gml:X>-1</gml:X><gml:Y>-3.270344827586211</gml:Y></gml:coord>
<gml:coord><gml:X>10.0441379310345</gml:X><gml:Y>6.468552677345371</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:oriented_bounds fid="polys.4">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,-3 7.69811320754717,0.056603773584906 3.80943396226415,2.21698113207547 2.11132075471698,-0.839622641509436 6,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.0,-3.0 7.69811320754717,0.056603773584905 3.80943396226415,2.21698113207547 2.11132075471698,-0.839622641509436 6.0,-3.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:intval>120</ogr:intval>
<ogr:floatval>-100291.43213</ogr:floatval>
<ogr:name xsi:nil="true"/>
<ogr:width>3.496629</ogr:width>
<ogr:height>4.448489</ogr:height>
<ogr:angle>119.054604</ogr:angle>
@@ -25,34 +26,35 @@
</gml:featureMember>
<gml:featureMember>
<ogr:oriented_bounds fid="polys.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.11764705882353,3.52941176470588 6.0,4.0 5.72941176470588,5.08235294117647 3.84705882352941,4.61176470588235 4.11764705882353,3.52941176470588</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.6332734,5.0792647 3.84029,4.4700214 4.2070166,3.3907567 6,4 5.6332734,5.0792647</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:intval>-33</ogr:intval>
<ogr:floatval>0</ogr:floatval>
<ogr:name>Aaaaa</ogr:name>
<ogr:width>1.940285</ogr:width>
<ogr:height>1.115664</ogr:height>
<ogr:angle>165.963757</ogr:angle>
<ogr:area>2.164706</ogr:area>
<ogr:perimeter>6.111898</ogr:perimeter>
<ogr:width>1.893665</ogr:width>
<ogr:height>1.139869</ogr:height>
<ogr:angle>161.232595</ogr:angle>
<ogr:area>2.158529</ogr:area>
<ogr:perimeter>6.067067</ogr:perimeter>
</ogr:oriented_bounds>
</gml:featureMember>
<gml:featureMember>
<ogr:oriented_bounds fid="polys.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1.0,3.0 -1.0,-1.0 3.0,-1.0 3.0,3.0 -1.0,3.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 3,-1 3,3 -1,3 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:intval>33</ogr:intval>
<ogr:floatval>44.12346</ogr:floatval>
<ogr:name>aaaaa</ogr:name>
<ogr:width>4.000000</ogr:width>
<ogr:height>4.000000</ogr:height>
<ogr:angle>90.000000</ogr:angle>
<ogr:angle>0.000000</ogr:angle>
<ogr:area>16.000000</ogr:area>
<ogr:perimeter>16.000000</ogr:perimeter>
</ogr:oriented_bounds>
</gml:featureMember>
<gml:featureMember>
<ogr:oriented_bounds fid="polys.3">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.4,-3.0 9.64413793103449,-3.27034482758621 10.0441379310345,1.52965517241379 6.8,1.8 6.4,-3.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.4,-3 9.6441379,-3.2703448 10.0441379,1.5296552 6.8,1.8 6.4,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:intval>0</ogr:intval>
<ogr:floatval xsi:nil="true"/>
<ogr:name>ASDF</ogr:name>
<ogr:width>3.255383</ogr:width>
<ogr:height>4.816638</ogr:height>
@@ -63,19 +65,20 @@
</gml:featureMember>
<gml:featureMember>
<ogr:oriented_bounds fid="polys.2">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.36470588235294,4.94117647058824 2.1,4.5 3.0,6.0 2.26470588235294,6.44117647058824 1.36470588235294,4.94117647058824</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.1679275,5.4220069 1.6,4.8 3.1065959,5.8465458 2.6745233,6.4685527 1.1679275,5.4220069</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:intval xsi:nil="true"/>
<ogr:floatval>0.123</ogr:floatval>
<ogr:name>bbaaa</ogr:name>
<ogr:width>0.857493</ogr:width>
<ogr:height>1.749286</ogr:height>
<ogr:angle>30.963757</ogr:angle>
<ogr:area>1.500000</ogr:area>
<ogr:perimeter>5.213557</ogr:perimeter>
<ogr:width>0.757350</ogr:width>
<ogr:height>1.834418</ogr:height>
<ogr:angle>55.214507</ogr:angle>
<ogr:area>1.389297</ogr:area>
<ogr:perimeter>5.183536</ogr:perimeter>
</ogr:oriented_bounds>
</gml:featureMember>
<gml:featureMember>
<ogr:oriented_bounds fid="polys.5">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,-3 7.69811320754717,0.056603773584906 3.80943396226415,2.21698113207547 2.11132075471698,-0.839622641509436 6,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.0,-3.0 7.69811320754717,0.056603773584905 3.80943396226415,2.21698113207547 2.11132075471698,-0.839622641509436 6.0,-3.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:intval>2</ogr:intval>
<ogr:floatval>3.33</ogr:floatval>
<ogr:name>elim</ogr:name>

0 comments on commit 7f00a40

Please sign in to comment.
You can’t perform that action at this time.