Creating iNaturalist places and linking to Wikidata using geojson

Do we have an approach for creating iNaturalist place id from geoJson

We have in Sweden now all nature reserve in Wikidata and have the geojson from the Swedish Environmental Protection Agency “Naturvårdsverket”
e.g. https://www.wikidata.org/wiki/Q23929994
and we have an area as geojson
https://commons.wikimedia.org/wiki/Data:/Sweden/Nature_reserves/2020/Velamsund/2001394.map

https://map.wikilovesearth.se/#59.41819,18.22083,10z

It would be cool to have an approach to create

  1. create the area in iNaturalist based on the geojson
  2. get a place id for it
  3. get a list of those place ids and the related WD objects Qnumber
  4. update Wikidata with this iNaturalist place id P7471

With this connection I can see that we speak with officials in Sweden and let them know that on the information page they also can have links to observations registered in iNaturalists or latest picture on social media like Instagram… as they also have place ids in Wikidata…
.e.g.

SPARQL

4 Likes

a couple of thoughts first: it’s probably best to create a place in iNaturalist only if someone is actually going to use it and/or manage it, not simply because a geoJSON file exists. because iNaturalist places are generally editable only by the creator of the place (unless admin or curator), it might be useful to have, say, a Swedish parks authority create these places in iNaturalist so that they can manage them later, if needed.

that said, it’s not difficult to use a geoJSON to create an iNaturalist place. first, you need something that can convert geoJSON to KML. (i would typically use something like QGIS, since it’s free, relatively well-documented, and can be used for other GIS tasks.) use your conversion tool to turn the geoJSON to KML. then create your place in iNaturalist using the KML file. that’s it.

one more note: Abisko National Park has already been created in iNaturalist as 120912, and the P7471 record in Wikidata has been created.

oh… one more thing: make sure the resulting KML has just one feature in it. for example, if your source geoJSON file has multiple parks in it, and you want to load each park as its own place, you need to chop it up and create a separate KML for each park. (QGIS can handle that kind of task.)

2 Likes

Thanks for the feedback… I am a rather newbie using iNaturalist what do you mean by manage them? I think they are also available in kml if that makes it easier

Those geojson are Open Data from the Swedish Environmental protection agency web (swedish “Naturvårdsverket”) and those areas are decided by regulations so they are very stable as stable as Sweden will be ;-)

The map contains links to the regulation deciding them etc…

As we have all this data in Wikidata and in sv:Wikipedia we have articles I feel it will be easy for local web sites to link Wikipedia and also iNaturalist so people planning to visit those areas understand latest flowers/birds found in the natural reserve…

About

1 Like

creating new Places is very taxing on the iNaturalist servers, so it’s best not to create a Place that won’t be used. And ideally the user who created them should remain active on the site, because only the creator of a Place, and Curators, can edit or delete that Place.

i mean that it’s helpful to have someone actually keeping tabs on places that they create. each place created has an impact – large or small – on the overall performance of the entire system. so the worst thing is to create a place that is never used by anyone. but it could be just as bad if you create a place that is used but then, say, the name of the place changes (which happens even with national parks), and then instead of someone looking after the place changing the name of the original place, someone else comes along and creates a second place with a different name.

3 Likes

Hi, a noob here myself, with a request. If you do have the means, would you please consider adding the nature reserves Garnudden (Salem), Vinterskogen (Botkyrka) and Rågsved (Stockholm)? I often frequent them, and it would be neat to keep tabs of what is seen there, but I don’t know how to create places myself.

1 Like

Yes, or if/when the boundaries change.

i won’t add them, but i will provide some general instruction on how to add them, with these caveats:

based on salgo60’s notes, you can find data for Swedish parks and reserves, including geoJSONs, using:

just to speed things up, the geoJSONs for your parks of interest are:

so suppose you want to add Garnudden. click on the appropriate link above, and then save the results as a .json file on your machine (ex. “Gardnudden.json”). i’m going to use QGIS to convert geoJSON to KML. so download and install that from https://www.qgis.org/, if you don’t already have it. (or else use another converter, and skip past my instructions here about converting in QGIS.)

open up QGIS, and go to Layer > Add Layer > Add Vector Layer… in the pop-up window, go to the Source > Vector Dataset(s) box, and select the geoJSON file that you saved earlier. then click the Add button in the bottom-right of the pop-up window, and then close the pop-up window.

in your QGIS application, look in the bottom-left corner of the screen, and you should see a Layers pane with a layer corresponding to the vector layer you just added. right click on on that layer record, and select Export > Save Features As…

in the pop-up window, select KML as your format, and use the file selector to pick a file name (making sure you include the full path of where you want to save the file). click ok. you should now have your KML file.

you should be able to open up your KML with a text editor like Notepad to view the contents. mine looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Schema name="test" id="test">
	<SimpleField name="NVRID" type="string"></SimpleField>
	<SimpleField name="NAMN" type="string"></SimpleField>
	<SimpleField name="SKYDDSTYP" type="string"></SimpleField>
	<SimpleField name="BESLSTATUS" type="string"></SimpleField>
	<SimpleField name="URSBESLDAT" type="string"></SimpleField>
	<SimpleField name="URSGALLDAT" type="string"></SimpleField>
	<SimpleField name="SENGALLDAT" type="string"></SimpleField>
	<SimpleField name="LAN" type="string"></SimpleField>
	<SimpleField name="KOMMUN" type="string"></SimpleField>
	<SimpleField name="IUCNKAT" type="string"></SimpleField>
	<SimpleField name="FORVALTARE" type="string"></SimpleField>
	<SimpleField name="AREA_HA" type="float"></SimpleField>
	<SimpleField name="LAND_HA" type="float"></SimpleField>
	<SimpleField name="VATTEN_HA" type="float"></SimpleField>
	<SimpleField name="SKOG_HA" type="float"></SimpleField>
	<SimpleField name="GEOSTATUS" type="string"></SimpleField>
	<SimpleField name="DIARIENR" type="string"></SimpleField>
	<SimpleField name="LAGRUM" type="string"></SimpleField>
	<SimpleField name="BESLMYND" type="string"></SimpleField>
</Schema>
<Folder><name>test</name>
  <Placemark>
	<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>
	<ExtendedData><SchemaData schemaUrl="#test">
		<SimpleData name="NVRID">2021789</SimpleData>
		<SimpleData name="NAMN">Garnudden</SimpleData>
		<SimpleData name="SKYDDSTYP">Naturreservat</SimpleData>
		<SimpleData name="BESLSTATUS">Gällande</SimpleData>
		<SimpleData name="URSBESLDAT">2009/10/22</SimpleData>
		<SimpleData name="URSGALLDAT">2010/03/08</SimpleData>
		<SimpleData name="SENGALLDAT">2018/07/31</SimpleData>
		<SimpleData name="LAN">Stockholms Län</SimpleData>
		<SimpleData name="KOMMUN">Salem</SimpleData>
		<SimpleData name="IUCNKAT">0, Områden som ej kan klassificeras enligt IUCN: s system.</SimpleData>
		<SimpleData name="FORVALTARE">Salems kommun</SimpleData>
		<SimpleData name="AREA_HA">83.94</SimpleData>
		<SimpleData name="LAND_HA">66.84</SimpleData>
		<SimpleData name="VATTEN_HA">17.096</SimpleData>
		<SimpleData name="SKOG_HA">59.712</SimpleData>
		<SimpleData name="GEOSTATUS">Justerad mot fastighetskarta</SimpleData>
		<SimpleData name="DIARIENR">511-36956-2018</SimpleData>
		<SimpleData name="LAGRUM">Miljöbalken</SimpleData>
		<SimpleData name="BESLMYND">Kommun</SimpleData>
	</SchemaData></ExtendedData>
      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>17.7943747078601,59.1946566242114 17.7962758388628,59.1939988150657 17.7952905185779,59.1936827129594 17.7941076055953,59.1930587703863 17.793375988788,59.1926237474873 17.7930464262353,59.1921810122015 17.7932056146254,59.1917199066631 17.7921153743623,59.1911660180634 17.7914654204751,59.1911335753034 17.7907476595494,59.1911146623509 17.7906762993561,59.1911127807737 17.7877300895429,59.1904439907117 17.7860305415402,59.1905554324563 17.7852199837343,59.190608583473 17.7799697664399,59.1903036818637 17.7770327059779,59.189460140371 17.7760331527237,59.1885328072252 17.7749112260782,59.1879036465673 17.7738936909919,59.1875915165619 17.7726354561248,59.1874509077203 17.7708902744945,59.187606166634 17.7695688813779,59.1879593816547 17.7684364112441,59.1883929205666 17.7668326171042,59.1899024127171 17.7664267269076,59.1900420720356 17.7652926566603,59.1904536737656 17.7652587835054,59.190467046143 17.7653091951543,59.1905035768274 17.7653377351288,59.1905245252045 17.7654081579668,59.1905674857258 17.7635502832322,59.1911671661085 17.7623963869682,59.1915653078309 17.7617668339429,59.1917803771859 17.7614839576191,59.1919895666619 17.7623965430056,59.1920539993534 17.7630890314814,59.1920540903819 17.763907180399,59.1919578052623 17.7655751232115,59.1919901859655 17.7668340753905,59.1921027076181 17.7673060368299,59.1921027371717 17.7674320080022,59.1920867196223 17.7678095751772,59.1920867632685 17.767841236897,59.1923758397172 17.767841447863,59.1926649482291 17.7681562313129,59.1927934534055 17.7687541981117,59.19279353357 17.7687858061007,59.1929219796604 17.7693523466786,59.1929381636916 17.7721535370969,59.1933559341054 17.7725628892145,59.1934845136296 17.772940636326,59.1936129308143 17.7747031968614,59.1938218773787 17.7756527483017,59.1938880701469 17.7757632419925,59.1935423778056 17.776542981167,59.193560993118 17.7763604204616,59.1938995104405 17.7802522329976,59.1942547295913 17.7808123913545,59.1943374386762 17.7809556003928,59.1942889162564 17.7812313007039,59.194321535168 17.7812890254468,59.1943861085938 17.7822200094069,59.1944751416902 17.7824277581448,59.1943874518829 17.7825564209479,59.1943694032212 17.782692723695,59.1943720639147 17.782894317816,59.1943919167983 17.7829714821053,59.1944476088748 17.7830222670353,59.1945471666811 17.7831084232808,59.1945527970185 17.7836625885807,59.1946383269568 17.7844701129948,59.1947884932606 17.7849567817853,59.1948634507932 17.7861158558339,59.1950207262591 17.7864202921765,59.1950737709361 17.7871894552456,59.195213502564 17.7876991507857,59.1953163859086 17.7887046075778,59.1954583437147 17.7901763605806,59.1956804048878 17.7914178120352,59.1957810624287 17.7933367659432,59.1951545439169 17.7933365776631,59.1949940049003 17.794123166243,59.1948654288422 17.7943747078601,59.1946566242114</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
  </Placemark>
</Folder>
</Document></kml>

now go to the Place screen in iNaturalist: https://www.inaturalist.org/places. before you create any place, first search for it to see if it already exists. if not, click on the button or link to Add a New Place.

from there, give the place a name (ex. “Garnudden”), an optional parent place (ex. “Salem” or “Sweden”), and then select the KML file you created earlier. i tend to leave the place type undefined, or you could select something like “Open Space”. then click save place. (more information on creating places is available if you go here: https://www.inaturalist.org/pages/getting+started, and then click on the Places tab.)

that’s it.

5 Likes

Thanks for the feedback… and I agree maintaining the data is the big challenge therefore I think we should try to do this in a structured way and I think if iNaturalist connects to more communities like Wikidata errors will be found faster

I did a map of protected areas in Wikidata and we have > 83000 and just 83 are connected to iNaturalist see map below (you can filter upper right)

same map but WDPA World Database on Protected Areas --> of > 39000 just 67 was connected with iNaturalist so I feel it is a potential but I guess best is if this is done in a structured way and also that iNaturalist starts point back on Wikidata / World Database on Protected Areas and in the Swedish case also the official source for the data (Swedish Environmental protection agency has property P3613 in Wikidata --> map and as you saw they have data about the area so that I guess is a good match… the challenge I start seeing in Wikidata is that we have > 4000 external identifiers (same query but just properties someone think is related to taxons) and we need better communication with organisations like the Swedish Environmental protection agency

I have worked with international money transactions and then we had a fast easy way of communicate if Bank of America didnt receive 100 million $ … maybe a name change on a protected area is not so urgent for most people but I guess you need an infrastructure and a mentality that I miss today when Wikidata connect external identifiers… I did a draft of middle layer between Wikidata and the datasource to make needed communication easier and also having a database for changing differences in data… see T251225#6105481

Update: had an email conversation today with "Swedish Environmental Protection Agency “Naturvårdsverket” and they will open a web called data for developers so all input what we would like to see is welcome…

4 Likes

i don’t disagree with your idea – in a world with unlimited resources. but i just don’t see a situation where there’s going to be a single de facto / preferred repository for GIS data any time soon, and in the absence of that, i’m guessing the cost / benefit balance for developing and supporting an interface to get data from Wikidata into iNaturalist and then back to Wikidata weighs much more heavily on the costs side.

take Goukamma Nature Reserve, your first example of potential duplicates in iNaturalist. it’s neat that there’s a way in Wikidata to find potential duplicates in iNaturalist, but you might be able to do something similar in iNaturalist. and if you look in Wikidata, there is not a geoJSON for that reserve. so Wikidata couldn’t serve as a source for geography in that case.

if you just wanted to add iNaturalst Place ID records to Wikidata en masse, i think that might be something that anyone with some coding skills could do…

4 Likes

That would be magic and I feel Wikidata has always had this problem that we cant trust the data providers that they have skills/tools/change process/ a prioritize backlog so we easier can plan…

As you said Open Data needs skill and resources and understanding… we can see over in Wikidata land that a few people do magic but its not for everyone doing everything… adding external identifiers is a step 1 and it looks like for iNaturalist taxon ID Wikidata has some added value… and today we have a very good integration between iNaturalist and Wikidata, listen to Wikipedia Weekly how Wikidata use iNaturalist for finding CC-0 pictures for species that dont have pictures in WIkipedia articles etc…

  • my feeling

    • we need to agree about direction… is nature reserves something wanted in iNaturalist…
    • then start with the low hanging fruits maybe Sweden is one we have at least a first dialogue in Sweden with the people owning the data and they distribute it with an Open license… I pray that this a low hanging fruit…
  • My guess we need also some support from the iNaturalist dev team

    • add some more external identifiers to iNaturalist like
      • Wikidata ID
      • maybe Swedish Environment id and mark them as the source
        • best would be to find a lifecycle management that we easy can check when they change or delete a nature reservation… as said earlier I see all the time the problem when Wikidata tries to connect with external providers
          • lack of persistent identifiers
          • no easy way to see change history
          • lack of same as → much more difficult to connect
          • good pattern is if they support SPARQL federation
      • maybe OSM relation id

  • Goukamma Nature Reserve we have in iNaturalist the outline and JSON places/122711
    • Wikidata has OSM relation Q31917725#P402 = openstreetmap relation/2928668 which feels like a good start and OSM reference back to Wikidata
    • getting the Swedish solution running maybe we can get others like South Africa to also move direction Open data for natural reserves…

Finding duplicates

3 Likes

@jensu you can always get observations using a bounding box see this bounding box e.g. Uttran bbox

  • 59.172944
  • 17.687027
  • 59.200731
  • 17.810623

https://www.inaturalist.org/observations?nelat=59.200731&nelng=17.810623&order_by=observed_on&place_id=any&swlat=59.172944&swlng=17.687027&verifiable=any

1 Like

Thank you, I ended up creating those three reserves using the excellent guide by @pisum, AND took care to add their ID to WD :blush:

4 Likes

Nice @jensu I did a video of what you did in Swedish and shared it with Södertäljen municipal and a person at the Swedish Environmental Protection Agency

As we now have a place location we can also create a widget for the place that can be used on any web page see example Garnudden

3 Likes
  • If I run iNaturalist in Swedish it finds the Swedish Wikipedia article when I click About
  • Not when I run it in English

Check json places/152114

As the place name is Garnuddens naturreservat, ST, SE i guess it tries to find the article doing text search instead of using Wikidata and iNaturalist place location

Correct would be to ask Wikipedia for the english article corresponding to the iNaturalist place id 152114 and as the Wikidata property is Property:P7471 then this hub tool can help

2 Likes

as far as i know, this not currently possible in iNaturalist, although it has been discussed, and there is a feature request for this: https://forum.inaturalist.org/t/add-additional-names-to-the-same-place/5480.

as far as I can tell, the link to Wikipedia is based on a “text search”, but it’s based on the display name of the place, rather than the name of the place. it’s possible that adding a record for “Garnuddens naturreservat” in English Wikipedia and redirecting it to the English “Garnudden Nature Reserve” article might establish the link in iNaturalist when viewed in English, with the caveat that there may be quirks like what’s noted here: https://forum.inaturalist.org/t/wikipedia-content-not-recognized-by-inat-place/9997.

2 Likes

Thanks

I tested create 2 redirects for “Granudden” places/152114 / json

  1. using the SLUG
    1. garnuddens-naturreservat --> no success
  2. using the name
    1. Garnuddens_naturreservat --> no success

if I follow the link for " There is no Wikipedia page matching Garnuddens naturreservat Would you like to start one ?"

it works… and the correct page is displayed…

Best implementation is to ask Wikidata for the language version of the article… either by using the placeid and hope that Wikidata is updated with it or using the Wikidata Qnumber

  1. you can also use the syntax Special:GoToLinkedPage
    1. https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q18290091 --> enwiki
    2. https://www.wikidata.org/wiki/Special:GoToLinkedPage/svwiki/Q18290091 --> svwiki

that is the reason I think iNaturalist should have the Wikidata Qnumber stored for places

If we check number of languages that has at least one wiki article

2 Likes

before you conclude that this does not create a link in iNaturalist when viewed in English, remember to look at the thread i noted above:

(the gist of this is that if the Wikipedia page does not already exist before you try to view the link in iNaturalist the first time, then you may have to wait a period of time before iNaturalist will recognize any changes you’ve made on the Wikipedia side.)

2 Likes

30 or so days later, the Wikipedia description now shows up in the iNaturalist place page for Garnuddens naturreservat (https://www.inaturalist.org/places/152114):

(i don’t know why the iNat folks designed the page so that it waits so long to update Wikipedia content, but if anyone wants to reduce that lag, maybe they can start the process with a feature request…)

2 Likes

which thing are you referring to as it?