Geolocation

  • 15.5
This article is may not be up to date with the latest stable release of M4.

Description

The GeoLocation endpoint provides the API consumer with access to methods pertaining to mapped objects. The endpoint allows consumers to get Structure by address, get latitude/longitude by Structure and add map symbols.

Methods

URL base/MGeo/GeoLocation/Specification
Action GET
Description Returns a data dictionary that details the available web service methods related to the GeoLocation.
Parameters None
 Returns  A JSON object with method descriptions
Sample Return Object
[
  {
    "HttpAction": "Post",
    "MethodName": "GetStructureLatLong",
    "Description": "Returns Structure Latitude Longitude by providing StructuresTable, IDField and IDValue.",
    "Format": {
		"IDField": "IDFieldName",
		"StructuresTable": "StructuresTableName",
		"IDValue": 2147
	  }
  },
  {
    "HttpAction": "Post",
    "MethodName": "GetStructureByAddress",
    "Description": "Returns a record for a single Structure with a match to the address specified in the address parameter.",
    "Format": {
		"Address": "234 North Street, Washington, DC 20002"
	  }
  },
  {
    "HttpAction": "Post",
    "MethodName": "MapSymbol",
    "Description": "Returns a record for a single Structure with a match to the address specified in the address parameter.",
    "Format": {
		"ID": 123,
		"TableName": "TableName",
		"Layer": 123,
		"Symbol": 123,
		"GType": 123,
		"Scale": 123.0,
		"Angle": 123.0,
		"Lat": 123.0,
		"Lon": 123.0,
		"MapName": "MapName",
		"MapSheets": true
	  }
  }
]
URL base/MGeo/GeoLocation/MapSymbol
Action POST
Description Returns a boolean value (true/false) based on the success of adding the Map symbol.
Parameters
Name Required? Type Description
ID Yes Integer ID value of the gived table parameter.
TableName Yes String Database Table name
Layer Yes Integer Map integer Layer value.
Symbol No Integer Map integer Symbol value.
GType Yes Integer Map integer GType value.
Scale No Double Map Scale value.
Angle No Double Map Angle value.
Lat Yes Double Map Latitude Value.
Lon Yes Double Map Langitude Value.
MapName No String The name of the Map.
MapSheets Yes Boolean MapSheets value in boolean.
Sample JSON Package
{
	"ID": 123,
	"TableName": "TableName",
	"Layer": 123,
	"Symbol": 123,
	"GType": 123,
	"Scale": 123.0,
	"Angle": 123.0,
	"Lat": 123.0,
	"Lon": 123.0,
	"MapName": "MapName",
	"MapSheets": true
}
Returns A JSON Ticket data object
Sample Return Object
{
  "Success": True
}
Business Rules
Any violations of these business rules result in an appropriate error message being returned to the API consumer.

ID:
  • The ID is a required field.
TableName:
  • The TableName is a required field.
Layer:
  • The Layer is a required field.
GType:
  • The GType is a required field.
Lat:
  • The Latitude is a required field.
  • The Latitude must be between 90 to -90.
Lon:
  • The Longitude is a required field.
  • The Longitude must be between 180 to -180.
MapSheets:
  • The MapSheets is a required field.
URL base/MGeo/GeoLocation/CheckPlantByWKT
Action POST
Description Returns a response object with a summary true or false value, a message response, and individual layer response values.
Parameters
Name Required? Type Description
WKT Yes String The Well Known Text string of a polygon.
BufferUnits Yes Integer The buffer to be applied to the polygon.
LayerIDs Yes List of Integers JSON list of layer IDs
SRID No Integer The SRID to be applied to the polygon, if other than zero.
Sample JSON Package
{
    "WKT": "LINESTRING(0 2, 2 0, 4 2)",
    "BufferUnits": 2,
    "LayerIDs": [1, 20, 88, 400, 888, 999],
    "SRID": 0
}

Returns A JSON Structure data object
Sample Return Object
{
    "Summary": true,
    "Messages": "Missing: 888, 999",
    "Layers":[ 
        { Layer: 1, Result: 1 }, 
        { Layer: 20, Result: 1 }, 
        { Layer: 88, Result: 0 }, 
        { Layer: 400, Result: 0 }, 
        { Layer: 888, Result: -1 }, 
        { Layer: 999, Result: -1 }
    ]
}
Business Rules
  • The SRID is assumed to match the objects contained in the layers provided.
  • Layers that do not exist will return a -1 in the individual detail, and be listed as Missing in the message. If no layers are missing, the Message will be "OK".
URL base/MGeo/GeoLocation/CheckPlantByFeatureBoundary
Action POST
Description Returns a response object with a summary true or false value, a message response, and individual layer response values.
Parameters
Name Required? Type Description
TableName Yes String The Table Name used with the Table ID to identify the boundary object.
TableID Yes Integer The Table ID used with the Table Name to identify the boundary object.
BufferUnits Yes Integer The buffer to be applied to the boundary object.
LayerIDs Yes List of Integers JSON list of layer IDs
Sample JSON Package
{
    "TableName": "WaterFeatures",
    "TableID": 777,
    "BufferUnits": 2,
    "LayerIDs": [1, 20, 88, 400, 888, 999]
}
Returns A JSON Structure data object
Sample Return Object
{
    "Summary": true,
    "Messages": "Missing: 888, 999",
    "Layers":[ 
        { Layer: 1, Result: 1 }, 
        { Layer: 20, Result: 1 }, 
        { Layer: 88, Result: 0 }, 
        { Layer: 400, Result: 0 }, 
        { Layer: 888, Result: -1 }, 
        { Layer: 999, Result: -1 }
    ]
}
Business Rules
  • The SRID is assumed to match the objects contained in the layers provided.
  • Layers that do not exist will return a -1 in the individual detail, and be listed as Missing in the message. If no layers are missing, the Message will be "OK".
URL base/MGeo/GeoLocation/GetLayers
Action GET
Description Returns a complete list of layers in MGeo Legends.
No Parameters
Returns A JSON data object
Sample Return Object
[
{
    "ID": 0,
    "LegendName": "Sample Data",
    "LayerNumber": 0,
    "LayerName": "Sample Data",
    "TableName": "Sample Data",
    "Color": 0,
    "LineStyle": 0,
    "Width": 0,
    "PointFont": 0,
    "PointSize": 0,
    "TextFont": 0,
    "TextHeight": 0,
    "TextWidth": 0,
    "Italics": false,
    "LineFont": 0,
    "LineSymSize": 0,
    "LineSymStart": 0,
    "LineSymEnd": 0,
    "DBText1": "Sample Data",
    "DBText2": "Sample Data",
    "DBText3": "Sample Data",
    "DBText4": "Sample Data",
    "DBText5": "Sample Data",
    "DBText6": "Sample Data",
    "DBText7": "Sample Data",
    "DBText8": "Sample Data",
    "DBText9": "Sample Data",
    "DBText10": "Sample Data",
    "ShapeMode": 0,
    "ShapeColor": 0,
    "ShapeAlpha": 0,
    "ShapeHatch": 0,
    "PColor": 0,
    "PLineStyle": 0,
    "PWidth": 0,
    "RestrictToMap": "Sample Data",
    "AllowLines": false,
    "AllowPoints": false,
    "AllowText": false,
    "AllowDBText": false,
    "SymbolList": "Sample Data",
    "PointAngle0": false,
    "PointScale1": false,
    "TextAngle0": false,
    "TextScale1": false,
    "TextJustification": 0,
    "GroupInput": false,
    "GroupDBText1Input": false,
    "GroupDBText2Input": false,
    "GroupDBText3Input": false,
    "GroupDBText4Input": false,
    "GroupDBText5Input": false,
    "GroupDBText6Input": false,
    "GroupDBText7Input": false,
    "GroupDBText8Input": false,
    "GroupDBText9Input": false,
    "GroupDBText10Input": false,
    "ManyDBText1": false,
    "ManyDBText2": false,
    "ManyDBText3": false,
    "ManyDBText4": false,
    "ManyDBText5": false,
    "ManyDBText6": false,
    "ManyDBText7": false,
    "ManyDBText8": false,
    "ManyDBText9": false,
    "ManyDBText10": false,
    "DBText1Angle0": false,
    "DBText2Angle0": false,
    "DBText3Angle0": false,
    "DBText4Angle0": false,
    "DBText5Angle0": false,
    "DBText6Angle0": false,
    "DBText7Angle0": false,
    "DBText8Angle0": false,
    "DBText9Angle0": false,
    "DBText10Angle0": false,
    "DBText1Scale1": false,
    "DBText2Scale1": false,
    "DBText3Scale1": false,
    "DBText4Scale1": false,
    "DBText5Scale1": false,
    "DBText6Scale1": false,
    "DBText7Scale1": false,
    "DBText8Scale1": false,
    "DBText9Scale1": false,
    "DBText10Scale1": false,
    "DBText1Justification": 0,
    "DBText2Justification": 0,
    "DBText3Justification": 0,
    "DBText4Justification": 0,
    "DBText5Justification": 0,
    "DBText6Justification": 0,
    "DBText7Justification": 0,
    "DBText8Justification": 0,
    "DBText9Justification": 0,
    "DBText10Justification": 0,
    "MinZoomLevel": 0,
    "PrevMinZoomLevel": 0,
    "PointMarkers": false,
    "MarkerImage": "Sample Data"
}
]
URL base/MGeo/GeoLocation/GetLayersByTableName
Action GET
Description Returns a complete list of layers in MGeo Legends.
Parameters
Name Required? Type Description
TableName Yes String The Table Name used with the Table ID to identify the boundary object.
Returns A JSON data object
Sample Return Object
[
{
    "ID": 0,
    "LegendName": "Sample Data",
    "LayerNumber": 0,
    "LayerName": "Sample Data",
    "TableName": "Sample Data",
    "Color": 0,
    "LineStyle": 0,
    "Width": 0,
    "PointFont": 0,
    "PointSize": 0,
    "TextFont": 0,
    "TextHeight": 0,
    "TextWidth": 0,
    "Italics": false,
    "LineFont": 0,
    "LineSymSize": 0,
    "LineSymStart": 0,
    "LineSymEnd": 0,
    "DBText1": "Sample Data",
    "DBText2": "Sample Data",
    "DBText3": "Sample Data",
    "DBText4": "Sample Data",
    "DBText5": "Sample Data",
    "DBText6": "Sample Data",
    "DBText7": "Sample Data",
    "DBText8": "Sample Data",
    "DBText9": "Sample Data",
    "DBText10": "Sample Data",
    "ShapeMode": 0,
    "ShapeColor": 0,
    "ShapeAlpha": 0,
    "ShapeHatch": 0,
    "PColor": 0,
    "PLineStyle": 0,
    "PWidth": 0,
    "RestrictToMap": "Sample Data",
    "AllowLines": false,
    "AllowPoints": false,
    "AllowText": false,
    "AllowDBText": false,
    "SymbolList": "Sample Data",
    "PointAngle0": false,
    "PointScale1": false,
    "TextAngle0": false,
    "TextScale1": false,
    "TextJustification": 0,
    "GroupInput": false,
    "GroupDBText1Input": false,
    "GroupDBText2Input": false,
    "GroupDBText3Input": false,
    "GroupDBText4Input": false,
    "GroupDBText5Input": false,
    "GroupDBText6Input": false,
    "GroupDBText7Input": false,
    "GroupDBText8Input": false,
    "GroupDBText9Input": false,
    "GroupDBText10Input": false,
    "ManyDBText1": false,
    "ManyDBText2": false,
    "ManyDBText3": false,
    "ManyDBText4": false,
    "ManyDBText5": false,
    "ManyDBText6": false,
    "ManyDBText7": false,
    "ManyDBText8": false,
    "ManyDBText9": false,
    "ManyDBText10": false,
    "DBText1Angle0": false,
    "DBText2Angle0": false,
    "DBText3Angle0": false,
    "DBText4Angle0": false,
    "DBText5Angle0": false,
    "DBText6Angle0": false,
    "DBText7Angle0": false,
    "DBText8Angle0": false,
    "DBText9Angle0": false,
    "DBText10Angle0": false,
    "DBText1Scale1": false,
    "DBText2Scale1": false,
    "DBText3Scale1": false,
    "DBText4Scale1": false,
    "DBText5Scale1": false,
    "DBText6Scale1": false,
    "DBText7Scale1": false,
    "DBText8Scale1": false,
    "DBText9Scale1": false,
    "DBText10Scale1": false,
    "DBText1Justification": 0,
    "DBText2Justification": 0,
    "DBText3Justification": 0,
    "DBText4Justification": 0,
    "DBText5Justification": 0,
    "DBText6Justification": 0,
    "DBText7Justification": 0,
    "DBText8Justification": 0,
    "DBText9Justification": 0,
    "DBText10Justification": 0,
    "MinZoomLevel": 0,
    "PrevMinZoomLevel": 0,
    "PointMarkers": false,
    "MarkerImage": "Sample Data"
}
]
URL base/MGeo/GeoLocation/GetLayerByNumber/ID
Action GET
Description Returns the layer object matching the passed in ID.
Parameters
Name Required? Type Description
Layer Number Yes Integer The ID of the Layer.
Returns A JSON data object
Sample Return Object
{
    "ID": 0,
    "LegendName": "Sample Data",
    "LayerNumber": 0,
    "LayerName": "Sample Data",
    "TableName": "Sample Data",
    "Color": 0,
    "LineStyle": 0,
    "Width": 0,
    "PointFont": 0,
    "PointSize": 0,
    "TextFont": 0,
    "TextHeight": 0,
    "TextWidth": 0,
    "Italics": false,
    "LineFont": 0,
    "LineSymSize": 0,
    "LineSymStart": 0,
    "LineSymEnd": 0,
    "DBText1": "Sample Data",
    "DBText2": "Sample Data",
    "DBText3": "Sample Data",
    "DBText4": "Sample Data",
    "DBText5": "Sample Data",
    "DBText6": "Sample Data",
    "DBText7": "Sample Data",
    "DBText8": "Sample Data",
    "DBText9": "Sample Data",
    "DBText10": "Sample Data",
    "ShapeMode": 0,
    "ShapeColor": 0,
    "ShapeAlpha": 0,
    "ShapeHatch": 0,
    "PColor": 0,
    "PLineStyle": 0,
    "PWidth": 0,
    "RestrictToMap": "Sample Data",
    "AllowLines": false,
    "AllowPoints": false,
    "AllowText": false,
    "AllowDBText": false,
    "SymbolList": "Sample Data",
    "PointAngle0": false,
    "PointScale1": false,
    "TextAngle0": false,
    "TextScale1": false,
    "TextJustification": 0,
    "GroupInput": false,
    "GroupDBText1Input": false,
    "GroupDBText2Input": false,
    "GroupDBText3Input": false,
    "GroupDBText4Input": false,
    "GroupDBText5Input": false,
    "GroupDBText6Input": false,
    "GroupDBText7Input": false,
    "GroupDBText8Input": false,
    "GroupDBText9Input": false,
    "GroupDBText10Input": false,
    "ManyDBText1": false,
    "ManyDBText2": false,
    "ManyDBText3": false,
    "ManyDBText4": false,
    "ManyDBText5": false,
    "ManyDBText6": false,
    "ManyDBText7": false,
    "ManyDBText8": false,
    "ManyDBText9": false,
    "ManyDBText10": false,
    "DBText1Angle0": false,
    "DBText2Angle0": false,
    "DBText3Angle0": false,
    "DBText4Angle0": false,
    "DBText5Angle0": false,
    "DBText6Angle0": false,
    "DBText7Angle0": false,
    "DBText8Angle0": false,
    "DBText9Angle0": false,
    "DBText10Angle0": false,
    "DBText1Scale1": false,
    "DBText2Scale1": false,
    "DBText3Scale1": false,
    "DBText4Scale1": false,
    "DBText5Scale1": false,
    "DBText6Scale1": false,
    "DBText7Scale1": false,
    "DBText8Scale1": false,
    "DBText9Scale1": false,
    "DBText10Scale1": false,
    "DBText1Justification": 0,
    "DBText2Justification": 0,
    "DBText3Justification": 0,
    "DBText4Justification": 0,
    "DBText5Justification": 0,
    "DBText6Justification": 0,
    "DBText7Justification": 0,
    "DBText8Justification": 0,
    "DBText9Justification": 0,
    "DBText10Justification": 0,
    "MinZoomLevel": 0,
    "PrevMinZoomLevel": 0,
    "PointMarkers": false,
    "MarkerImage": "Sample Data"
}
URL base/MGeo/GeoLocation/GetProject
Action GET
Description Returns simple project data.
No Parameters
Returns A JSON data object
Sample Return Object
{
    "ID": 0,
    "ProjectName": "Sample Data",
    "DBKeyField": "Sample Data",
    "LegendName": "Sample Data",
    "ImageDirectory": "Sample Data",
    "SRID": 0,
    "GeographyUnit": 0,
    "Areaunit": 0,
    "DistanceUnit": 0,
    "ProjectionString": "Sample Data",
    "MinScale": 0,
    "PlotTableName": "Sample Data",
    "DFMName": "Sample Data",
    "MenuName": "Sample Data",
    "DBTimeout": 0,
    "MapDirectory": "Sample Data",
    "DBIPIDField": "Sample Data",
    "ImageTablename": "Sample Data",
    "ImagelayerField": "Sample Data",
    "ImageDBKeyField": "Sample Data",
    "ImageFileField": "Sample Data",
    "AttributeDBConnectionString": "Sample Data",
    "MapDBConnectionString": "Sample Data",
    "ImageDescriptionField": "Sample Data",
    "ImageIdentityField": "Sample Data",
    "ImageExcludeFiles": "Sample Data",
    "ImageDeviceDirectory": "Sample Data",
    "FacilityXSize": 0.0,
    "FacilityYSize": 0.0,
    "FacilityStartX": 0.0,
    "FacilityStartY": 0.0,
    "FacilityNameX": "Sample Data",
    "FacilityNameY": "Sample Data",
    "Resolution": 0,
    "LinePatternName": "Sample Data",
    "CoordSystem": "Sample Data",
    "CoordUnits": "Sample Data",
    "CoordDatum": "Sample Data",
    "CoordZone": "Sample Data",
    "CacheEnabled": false,
    "MultiMapDirectory": false,
    "UpdaterDirectory": "Sample Data",
    "SyncExport": false,
    "ADOAttribConnString": "Sample Data",
    "ADOMapConnString": "Sample Data",
    "SpatialToAttribLink": "Sample Data",
    "AttribToSpatialLink": "Sample Data",
    "Font1Name": "Sample Data",
    "Font2Name": "Sample Data",
    "Font3Name": "Sample Data",
    "Font4Name": "Sample Data",
    "Font5Name": "Sample Data",
    "FMECoordinateSystemName": "Sample Data",
    "ReportServerURL": "Sample Data"
}
URL base/MGeo/GeoLocation/GetStructuresByLatLong
Action POST
Description Returns a list of structure objects with closest first.
Parameters
Name Required? Type Description
Latitude Yes float The Latitude at the center of the search zone (accurate to 3 decimal places).
Longitude Yes float The Longitude at the center of the search zone (accurate to 3 decimal places).
BufferUnits Yes Integer The buffer to be applied to the map point.
BufferUnitType Yes String 'F' for feet, or 'M' for meters.
Sample JSON Package
{
    "Longitude": 0.001,
    "Latitude": 0.001,
    "BufferUnits": 50,
    "BufferUnitType": "M"
}
Returns A JSON Structure data object
Sample Return Object
[
{
    "ID": 257381,
    "ParentID": 25,
    "FullAddress": "1234 Palm Tree Drive, Apt 12A, Sample City, VA 23236",
    "Description": "Barn like structure",
    "HouseNumber": "1234",
    "PreDirectional": "Up",
    "Street": "Palm Tree Drive",
    "StreetSuffix": "Apt 12A",
    "PostDirectional": "Down",
    "UnitNumber": "12A",
    "City": "Sample City",
    "State": "VA",
    "Zip_Code": "23236",
    "County": "Henrico",
    "Latitude": 1,
    "Longitude": 1,
    "CensusBlock": "060670011011085",
    "CensusTract": "06067001101",
    "Exchange": "Structure",
    "StructureType": "Res",
    "Comments": "This is a comment.",
    "COID": 24,
    "LoopLength": 500,
    "Mapped": true,
    "LastUpdateUser": "Namey Namerson",
    "LastUpdateDate": "2015-01-30T08:50:54.373"
  },
  {
    "ID": 257396,
    "ParentID": null,
    "FullAddress": "2345 Palm Tree Drive, Sample City, VA 23236",
    "Description": "Barn like structure",
    "HouseNumber": "1234",
    "PreDirectional": "Up",
    "Street": "Palm Tree Drive",
    "StreetSuffix": "Apt 12A",
    "PostDirectional": "Down",
    "UnitNumber": "12A",
    "City": "Sample City",
    "State": "VA",
    "Zip_Code": "23236",
    "County": "Henrico",
    "Latitude": 1,
    "Longitude": 1,
    "CensusBlock": "060670011011085",
    "CensusTract": "06067001101",
    "Exchange": "Structure",
    "StructureType": "Res",
    "Comments": "This is a comment.",
    "COID": 24,
    "LoopLength": 500,
    "Mapped": true,
    "LastUpdateUser": "Namey Namerson",
    "LastUpdateDate": "2015-01-30T08:50:54.373"
}
]
Business Rules
  • The Longitude and the Latitude values must be accurate to 3 decimal places.
  • This API method only searches the spatial placement of mapped symbols tied to database records.

Was this article helpful?

Related Articles