Skip to main content
100%

Converts geographic entities from the Alchemy API to GeoJSON

✓ Published0🌍 Public
CCliffordAnderson
Last edited Oct 30, 2013
Created on Oct 30, 2013

This example converts named entities extracted from web-accessible texts into geographic features, producing a GeoJSON FeatureCollection where each entity with a disambiguated location becomes a point. It uses the Alchemy API’s URLGetRankedNamedEntities endpoint to fetch entity data, then filters for those that include geo coordinates. The XQuery code builds a JSON structure with a Point geometry, placing longitude and latitude into the coordinates array via string manipulation of the Alchemy geo field. Finally, it serializes the result using the BaseX json:serialize function, outputting a standard GeoJSON object for downstream mapping.

AI-generated description

Similar vizzes