Nyall Dawson b4b39996d2 Port hub lines algorithm to new API
Improvements:
- transparent reprojection to match hub/spoke CRS
- keep all attributes from matched hub/spoke features
- don't break after matching one hub point to spoke - instead
join ALL hub/spoke points with matching id values
2017-08-05 17:51:38 +10:00

85 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
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>-4.1675</gml:Y></gml:coord>
<gml:coord><gml:X>7</gml:X><gml:Y>3.8825</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:hub_lines fid="points.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>1,1 5.07625,-2.1725</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:id>1</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:fid_2>spoke_points.0</ogr:fid_2>
<ogr:id_2>1</ogr:id_2>
<ogr:name>point 1</ogr:name>
</ogr:hub_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:hub_lines fid="points.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,3 5.82,3.8825</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:id>2</ogr:id>
<ogr:id2>1</ogr:id2>
<ogr:fid_2>spoke_points.1</ogr:fid_2>
<ogr:id_2>2</ogr:id_2>
<ogr:name>point 2</ogr:name>
</ogr:hub_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:hub_lines fid="points.2">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2,2 1.62,1.4675</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:id>3</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:fid_2>spoke_points.2</ogr:fid_2>
<ogr:id_2>3</ogr:id_2>
<ogr:name>point 3</ogr:name>
</ogr:hub_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:hub_lines fid="points.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>5,2 6.68625,1.23125</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:fid_2>spoke_points.3</ogr:fid_2>
<ogr:id_2>4</ogr:id_2>
<ogr:name>point 4</ogr:name>
</ogr:hub_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:hub_lines fid="points.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>5,2 1.27875,-3.66875</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:fid_2>spoke_points.4</ogr:fid_2>
<ogr:id_2>4</ogr:id_2>
<ogr:name>point 4a</ogr:name>
</ogr:hub_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:hub_lines fid="points.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>5,2 3.81625,-4.1675</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:fid_2>spoke_points.5</ogr:fid_2>
<ogr:id_2>4</ogr:id_2>
<ogr:name>point 4b</ogr:name>
</ogr:hub_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:hub_lines fid="points.7">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-1 6.82625,-2.79375</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:id>8</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:fid_2>spoke_points.6</ogr:fid_2>
<ogr:id_2>8</ogr:id_2>
<ogr:name>point 8</ogr:name>
</ogr:hub_lines>
</gml:featureMember>
</ogr:FeatureCollection>