[mapguide-commits] r9221 - in sandbox/jng/geoprocessing: Common/Schema UnitTest/WebTier/MapAgent/MapAgentForms Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Jun 25 02:58:13 PDT 2017


Author: jng
Date: 2017-06-25 02:58:13 -0700 (Sun, 25 Jun 2017)
New Revision: 9221

Added:
   sandbox/jng/geoprocessing/Common/Schema/GeometryInfo-3.3.0.xsd
   sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geometryinfoform.html
   sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/tessellateform.html
Modified:
   sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geoprocessingapi.html
   sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj
   sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj.filters
   sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandlerBuild.cpp
   sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpRequest.cpp
   sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.cpp
   sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.h
   sandbox/jng/geoprocessing/Web/src/HttpHandler/XmlJsonConvert.cpp
Log:
Add the following operations to the mapagent:

 - GEO.TESSELLATE
   - Returns a tessellated version of the given input geometry (in WKT). This operation is mainly for approximating curve-based geometries and has no effect on non-curve based geometries (it will return the original WKT in such cases). Output can be WKT or GeoJSON with optional transformation.

 - GEO.GEOMETRYINFO
   - Given an input geometry (in WKT), this operation returns an assortment of information about this geometry, all of which is returned in a response modeled on a new GeometryInfo-3.3.0.xsd schema

Added: sandbox/jng/geoprocessing/Common/Schema/GeometryInfo-3.3.0.xsd
===================================================================
--- sandbox/jng/geoprocessing/Common/Schema/GeometryInfo-3.3.0.xsd	                        (rev 0)
+++ sandbox/jng/geoprocessing/Common/Schema/GeometryInfo-3.3.0.xsd	2017-06-25 09:58:13 UTC (rev 9221)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:element name="GeometryInfo">
+    <xs:annotation>
+      <xs:documentation>Geometry Information</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="Area" type="xs:double" />
+        <xs:element name="Dimension" type="xs:int" />
+        <xs:element name="Length" type="xs:double" />
+        <xs:element name="IsClosed" type="xs:boolean" />
+        <xs:element name="IsEmpty" type="xs:boolean" />
+        <xs:element name="IsSimple" type="xs:boolean" />
+        <xs:element name="IsValid" type="xs:boolean" />
+        <xs:element name="Envelope" type="Envelope" />
+        <xs:element name="Centroid" type="Coordinate" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="Coordinate">
+    <xs:annotation>
+      <xs:documentation>Represents a bounding box</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="X" type="xs:double">
+        <xs:annotation>
+          <xs:documentation>x-coordinate</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="Y" type="xs:double">
+        <xs:annotation>
+          <xs:documentation>y-coordinate</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="Envelope">
+    <xs:annotation>
+      <xs:documentation>Represents a bounding box defined in terms of a lower left coordinate and an upper right coordinate</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element name="LowerLeft" type="Coordinate">
+        <xs:annotation>
+          <xs:documentation>Lower-left coordinate</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="UpperRight" type="Coordinate">
+        <xs:annotation>
+          <xs:documentation>Upper-right coordinate</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geometryinfoform.html
===================================================================
--- sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geometryinfoform.html	                        (rev 0)
+++ sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geometryinfoform.html	2017-06-25 09:58:13 UTC (rev 9221)
@@ -0,0 +1,31 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<script type="text/javascript" src="setactiontarget.js" >
+</script>
+</head>
+<body>
+<form name="input" action="" method="get">
+<b>Operation:</b>
+<input type="text" name="OPERATION" value="GEO.GEOMETRYINFO" size="50">
+<p> Version:
+<input type="text" name="VERSION" value="3.3.0" size="10">
+<p> Locale:
+<input type="text" name="LOCALE" value="en" size="10">
+<p> Client Agent:
+<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+<p> Geometry (WKT):
+<input type="text" name="GEOMETRY" value="" size="100">
+<p> Output Format:
+<select name="FORMAT">
+    <option value="text/xml">text/xml</option>
+    <option value="application/json">application/json</option>
+</select>
+<p>
+    Clean JSON: <input type="text" name="CLEAN" value="1" ID="TextClean">
+<p>
+<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
+</form>
+</body>
+</html>
+<html>

Modified: sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geoprocessingapi.html
===================================================================
--- sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geoprocessingapi.html	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/geoprocessingapi.html	2017-06-25 09:58:13 UTC (rev 9221)
@@ -15,8 +15,12 @@
             <LI>
                 <A href="distanceform.html" target="showform">Distance</A>
             <LI>
+                <A href="geometryinfoform.html" target="showform">GeometryInfo</A>
+            <LI>
                 <A href="simplifyform.html" target="showform">Simplify</A>
             <LI>
+                <A href="tessellateform.html" target="showform">Tessellate</A>
+            <LI>
                 <A href="binaryoperationform.html" target="showform">BinaryOperation</A>
             <LI>
                 <A href="spatialpredicateform.html" target="showform">SpatialPredicate</A>

Added: sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/tessellateform.html
===================================================================
--- sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/tessellateform.html	                        (rev 0)
+++ sandbox/jng/geoprocessing/UnitTest/WebTier/MapAgent/MapAgentForms/tessellateform.html	2017-06-25 09:58:13 UTC (rev 9221)
@@ -0,0 +1,33 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<script type="text/javascript" src="setactiontarget.js" >
+</script>
+</head>
+<body>
+<form name="input" action="" method="get">
+<b>Operation:</b>
+<input type="text" name="OPERATION" value="GEO.TESSELLATE" size="50">
+<p> Version:
+<input type="text" name="VERSION" value="3.3.0" size="10">
+<p> Locale:
+<input type="text" name="LOCALE" value="en" size="10">
+<p> Client Agent:
+<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+<p> Geometry (WKT):
+<input type="text" name="GEOMETRY" value="" size="100">
+<p> Output Format:
+<select name="FORMAT">
+    <option value="WKT">Geometry Well-Known Text</option>
+    <option value="GEOJSON">GeoJSON</option>
+</select>
+<p> Input Coordinate System (CS-Map Code):
+<input type="text" name="COORDINATESYSTEM" value="" size="10">
+<p> Output Coordinate System (CS-Map Code):
+<input type="text" name="TRANSFORMTO" value="" size="10">
+<p>
+<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
+</form>
+</body>
+</html>
+<html>

Modified: sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj
===================================================================
--- sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj	2017-06-25 09:58:13 UTC (rev 9221)
@@ -306,6 +306,12 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="HttpGeometryInfo.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="HttpGeoSimplify.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -318,6 +324,12 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="HttpGeoTessellate.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="HttpGetRepositoryContent.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -997,8 +1009,10 @@
     <ClInclude Include="HttpGeoBuffer.h" />
     <ClInclude Include="HttpGeoBinaryOperation.h" />
     <ClInclude Include="HttpGeoDistance.h" />
+    <ClInclude Include="HttpGeometryInfo.h" />
     <ClInclude Include="HttpGeoSimplify.h" />
     <ClInclude Include="HttpGeoSpatialPredicate.h" />
+    <ClInclude Include="HttpGeoTessellate.h" />
     <ClInclude Include="HttpGetRepositoryContent.h" />
     <ClInclude Include="HttpGetRepositoryHeader.h" />
     <ClInclude Include="HttpGetResourceContent.h" />

Modified: sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj.filters
===================================================================
--- sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj.filters	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandler.vcxproj.filters	2017-06-25 09:58:13 UTC (rev 9221)
@@ -407,6 +407,12 @@
     <ClCompile Include="HttpGeoConvexHull.cpp">
       <Filter>GeoProcessing</Filter>
     </ClCompile>
+    <ClCompile Include="HttpGeometryInfo.cpp">
+      <Filter>GeoProcessing</Filter>
+    </ClCompile>
+    <ClCompile Include="HttpGeoTessellate.cpp">
+      <Filter>GeoProcessing</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="HttpApplyResourcePackage.h">
@@ -796,6 +802,12 @@
     <ClInclude Include="HttpGeoConvexHull.h">
       <Filter>GeoProcessing</Filter>
     </ClInclude>
+    <ClInclude Include="HttpGeometryInfo.h">
+      <Filter>GeoProcessing</Filter>
+    </ClInclude>
+    <ClInclude Include="HttpGeoTessellate.h">
+      <Filter>GeoProcessing</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="HttpHandler.rc" />

Modified: sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandlerBuild.cpp
===================================================================
--- sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandlerBuild.cpp	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpHandlerBuild.cpp	2017-06-25 09:58:13 UTC (rev 9221)
@@ -59,8 +59,10 @@
 #include "HttpGeoBinaryOperation.cpp"
 #include "HttpGeoConvexHull.cpp"
 #include "HttpGeoDistance.cpp"
+#include "HttpGeometryInfo.cpp"
 #include "HttpGeoSimplify.cpp"
 #include "HttpGeoSpatialPredicate.cpp"
+#include "HttpGeoTessellate.cpp"
 #include "HttpGetCapabilities.cpp"
 #include "HttpGetConnectionPropertyValues.cpp"
 #include "HttpGetDefaultTileSizeX.cpp"

Modified: sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpRequest.cpp
===================================================================
--- sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpRequest.cpp	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpRequest.cpp	2017-06-25 09:58:13 UTC (rev 9221)
@@ -129,8 +129,10 @@
 #include "HttpGeoBinaryOperation.h"
 #include "HttpGeoConvexHull.h"
 #include "HttpGeoDistance.h"
+#include "HttpGeometryInfo.h"
 #include "HttpGeoSimplify.h"
 #include "HttpGeoSpatialPredicate.h"
+#include "HttpGeoTessellate.h"
 
 #include <algorithm>
 using namespace std;
@@ -443,8 +445,10 @@
     httpClassCreators[MgHttpResourceStrings::opGeoBinaryOperation] = MgHttpGeoBinaryOperation::CreateObject;
     httpClassCreators[MgHttpResourceStrings::opGeoConvexHull] = MgHttpGeoConvexHull::CreateObject;
     httpClassCreators[MgHttpResourceStrings::opGeoDistance] = MgHttpGeoDistance::CreateObject;
+    httpClassCreators[MgHttpResourceStrings::opGeometryInfo] = MgHttpGeometryInfo::CreateObject;
     httpClassCreators[MgHttpResourceStrings::opGeoSimplify] = MgHttpGeoSimplify::CreateObject;
     httpClassCreators[MgHttpResourceStrings::opGeoSpatialPredicate] = MgHttpGeoSpatialPredicate::CreateObject;
+    httpClassCreators[MgHttpResourceStrings::opGeoTessellate] = MgHttpGeoTessellate::CreateObject;
 
     httpPostHandlerCreators.push_back(MgHttpWfsGetCapabilities::ProcessPostRequest);
     httpPostHandlerCreators.push_back(MgHttpWfsDescribeFeatureType::ProcessPostRequest);

Modified: sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.cpp	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.cpp	2017-06-25 09:58:13 UTC (rev 9221)
@@ -368,8 +368,10 @@
 const STRING MgHttpResourceStrings::opGeoBuffer = L"GEO.BUFFER";
 const STRING MgHttpResourceStrings::opGeoConvexHull = L"GEO.CONVEXHULL";
 const STRING MgHttpResourceStrings::opGeoDistance = L"GEO.DISTANCE";
+const STRING MgHttpResourceStrings::opGeometryInfo = L"GEO.GEOMETRYINFO";
 const STRING MgHttpResourceStrings::opGeoSimplify = L"GEO.SIMPLIFY";
 const STRING MgHttpResourceStrings::opGeoSpatialPredicate = L"GEO.SPATIALPREDICATE";
+const STRING MgHttpResourceStrings::opGeoTessellate = L"GEO.TESSELLATE";
 const STRING MgHttpResourceStrings::opGeoBinaryOperation = L"GEO.BINARYOPERATION";
 
 const STRING MgHttpResourceStrings::reqGeoA = L"GEOMETRYA";

Modified: sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.h	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/Web/src/HttpHandler/HttpResourceStrings.h	2017-06-25 09:58:13 UTC (rev 9221)
@@ -372,8 +372,10 @@
     static const STRING opGeoBuffer;
     static const STRING opGeoConvexHull;
     static const STRING opGeoDistance;
+    static const STRING opGeometryInfo;
     static const STRING opGeoSimplify;
     static const STRING opGeoSpatialPredicate;
+    static const STRING opGeoTessellate;
     static const STRING opGeoBinaryOperation;
 
     static const STRING reqGeoA;

Modified: sandbox/jng/geoprocessing/Web/src/HttpHandler/XmlJsonConvert.cpp
===================================================================
--- sandbox/jng/geoprocessing/Web/src/HttpHandler/XmlJsonConvert.cpp	2017-06-25 09:21:35 UTC (rev 9220)
+++ sandbox/jng/geoprocessing/Web/src/HttpHandler/XmlJsonConvert.cpp	2017-06-25 09:58:13 UTC (rev 9221)
@@ -946,6 +946,20 @@
     s_elementPathTypeMap["/ClassDefinition/Properties/Property/DefaultImageYSize"] = XML_DATA_TYPE_NUM_INT;
     //UnitOfMeasure-3.3.0.xsd
     s_elementPathTypeMap["/UnitOfMeasure/Value"] = XML_DATA_TYPE_NUM_DOUBLE;
+    //GeometryInfo-3.3.0.xsd
+    s_elementPathTypeMap["/GeometryInfo/Area"] = XML_DATA_TYPE_NUM_DOUBLE;
+    s_elementPathTypeMap["/GeometryInfo/Dimension"] = XML_DATA_TYPE_NUM_INT;
+    s_elementPathTypeMap["/GeometryInfo/Length"] = XML_DATA_TYPE_NUM_DOUBLE;
+    s_elementPathTypeMap["/GeometryInfo/IsClosed"] = XML_DATA_TYPE_BOOLEAN;
+    s_elementPathTypeMap["/GeometryInfo/IsEmpty"] = XML_DATA_TYPE_BOOLEAN;
+    s_elementPathTypeMap["/GeometryInfo/IsSimple"] = XML_DATA_TYPE_BOOLEAN;
+    s_elementPathTypeMap["/GeometryInfo/IsValid"] = XML_DATA_TYPE_BOOLEAN;
+    s_elementPathTypeMap["/GeometryInfo/Envelope/LowerLeft/X"] = XML_DATA_TYPE_NUM_DOUBLE;
+    s_elementPathTypeMap["/GeometryInfo/Envelope/LowerLeft/Y"] = XML_DATA_TYPE_NUM_DOUBLE;
+    s_elementPathTypeMap["/GeometryInfo/Envelope/UpperRight/X"] = XML_DATA_TYPE_NUM_DOUBLE;
+    s_elementPathTypeMap["/GeometryInfo/Envelope/UpperRight/Y"] = XML_DATA_TYPE_NUM_DOUBLE;
+    s_elementPathTypeMap["/GeometryInfo/Centroid/X"] = XML_DATA_TYPE_NUM_DOUBLE;
+    s_elementPathTypeMap["/GeometryInfo/Centroid/Y"] = XML_DATA_TYPE_NUM_DOUBLE;
     //Miscellaneous MapGuide response types that don't have a formal schema
     s_elementPathTypeMap["/SessionTimeout/Value"] = XML_DATA_TYPE_NUM_INT;
     s_elementPathTypeMap["/FeatureInformation/SelectedFeatures/SelectedLayer/LayerMetadata/Property/Type"] = XML_DATA_TYPE_NUM_INT;



More information about the mapguide-commits mailing list