The MarkLogic geonames project is a simple location extractor and enrichment service that uses MarkLogic and the geonames gazetteer.
- MarkLogic
- JDK 1.7
- Gradle 2.0
- MarkLogic Content Pump
- ml-java project (the dependency is indicated in build.gradle)
- Linux (tested with CentOS 6)
- ./geonames/gradle mlInstallApp
- ./geonames/gradle mlConfigureApp
- Remove any CPF domains from the geonames-content database
The geonames data is downloaded into a directory called data/. The geonames metadata needs to be downloaded and loaded first before downloading any of the country data. There is a script called headers.sh that is used to put the the tab delimited header on the country files that are downloaded.
./load-geonames-meta.sh
- This will download and load all the geonames metadata into MarkLogic: countryCodes, admin codes, feature codes
./download-geonames.sh [2 character ISO Country Code | all]
./download-geonames.sh SC
- Downloads the geonames for Seychelles (a small data set)
./download-geonames.sh FR
- Downloads and Loads the geonames for France
./download-geonames.sh all
- Downloads every country
./load-geonames.sh [2 character ISO Country Code | all]
./load-geonames.sh SC
- Loads the Seychellles geonames dataset into MarkLogic via mlcp
./load-geonames.sh all
- Loads all countries into MarkLogic
- Geonames API - http://:8010/v1/resources/api
- geo-enrich - http://:8010/v1/resources/geo-enrich
- http://:8010/v1/resources/geo-enrich?rs:text=I%20live%20in%20Paris%20and%20Normandy&rs:country-code=FR