Import/Sachsen-Anhalt Naturschutzgebiete/Wikidata

From OpenStreetMap Wiki
Jump to navigation Jump to search

This SPARQL query

#Naturschutzgebiete in Sachsen-Anhalt (Q1206)
SELECT ?nr ?nrLabel ?nrDescription ?website ?coord ?WDPA_id WHERE {
  ?nr wdt:P31 wd:Q759421.
  ?nr wdt:P131* wd:Q1206.
  ?nr wdt:P625 ?coord.
  OPTIONAL { ?nr wdt:P856 ?website. }
  OPTIONAL { ?nr wdt:P809 ?WDPA_id. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }
}

[1]

will load all entities that are (P:31) Naturschutzgebiete (Q759421), and located within the administrative boundary or any subdivision thereof (P:131*) of Saxony-Anhalt (Q1206).

This will be downloaded as CSV, loaded into QGIS and saved as shapefile.

An example of the attribute table looks like this:

nr nrLabel nrDescript website WDPA_id image
http://www.wikidata.org/entity/Q1669446 Ohre-Drömling Naturschutzgebiet in Sachsen-Anhalt, Deutschland 344828 http://commons.wikimedia.org/wiki/Special:FilePath/N%C3%B6rdlicher%20Dr%C3%B6mling%20im%20Ohre%20Dr%C3%B6mling.jpg
http://www.wikidata.org/entity/Q1739489 Ohreaue Naturschutzgebiet im Altmarkkreis Salzwedel, Sachsen-Anhalt, Deutschland 318911 http://commons.wikimedia.org/wiki/Special:FilePath/Steimke%20NSG.JPG

The following attribute transforms will then be performed:

new field name created with expression for QGIS field calculator
wikidata replace("nr", 'http://www.wikidata.org/entity/','')

The fields "nr","nrLabel","nrDescript","website" will be deleted.