Skip to content

Instantly share code, notes, and snippets.

@xwipeoutx
Created August 6, 2020 12:04
Show Gist options
  • Save xwipeoutx/adde8efb6455272a716f2f38cf185af2 to your computer and use it in GitHub Desktop.
Save xwipeoutx/adde8efb6455272a716f2f38cf185af2 to your computer and use it in GitHub Desktop.
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