Created
August 6, 2020 12:04
-
-
Save xwipeoutx/adde8efb6455272a716f2f38cf185af2 to your computer and use it in GitHub Desktop.
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
export async function getParcel(coords: {lat: number, lng: number}): Promise<Feature> { | |
let url = `https://gisservices.information.qld.gov.au/arcgis/rest/services/PlanningCadastre/LandParcelPropertyFramework/MapServer/4/query?geometry=${coords.lng}%2C${coords.lat}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&outSR=4326&f=geojson` | |
let response = await fetch(url); | |
let collection = await response.json(); | |
return (collection && collection.features[0]) || null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment