Place "Longitude must be greater than or equal to -180" error

Hi Team,

I’ve tried the forum but I’ve been told this is a genuine bug. https://forum.inaturalist.org/t/place-longitude-must-be-greater-than-or-equal-to-180/8319/10

I have spent some time trying to map a place but I keep getting the “Longitude must be greater than or equal to -180” error. I’ve also tried uploading a KML from Google Earth and still received this error.

Please help.

Greg

Your longitude should be 153.0314064717 (positive number). I think that should fix it.

1 Like

Are you using a kml file? If you share it, we could take a look.

Thanks all. No KML file. I don’t know what that is. I’ve just drawn it.

Do you recommend KML?

@gregtasney I’m guessing the place you are trying to draw must cross the -180 longitude line (on or near where the International Date Line runs). Longitude values can only be between -180 and +180, and the system should handle this appropriately when drawing across that line, so this may be a bug.

KML is a spatial feature format that comes from Google Earth. If you have Google Earth Pro, I think you can draw your place polygon there, then export it as a KML file. You can then upload the KML to iNaturalist to attempt creating your place.

If this workaround is successful, then your issue when trying to draw it directly should probably be submitted as a bug report.

yup. i just tried to create a place in the iNat place page by drawing a box that encompasses the eastern Fiji Islands, which span the +/-180 deg line, and i got the same error.

that said, the place did seem to be created, although it looks funny in the place page (https://www.inaturalist.org/places/145745), and it seems to pick up only observations only on the side with the negative longitudes (https://www.inaturalist.org/observations?place_id=145745).

so i went back to the place page and downloaded the KML file from the system, opened it in a text editor:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
  
  <Document>
    <Placemark>
  <name>pisum place test Border</name>
  <styleUrl>https://www.inaturalist.org/assets/index.kml#place</styleUrl>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-181.7742919921875,-15.88631935640978 -179.0771484375,-15.88631935640978 -179.088134765625,-17.323371664099753 -181.8402099609375,-17.260433005542946 -181.7742919921875,-15.88631935640978</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark>

  </Document>
</kml>

… and then fixed the bad longitudes (by adding 360 to longitudes less than -180):

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
  
  <Document>
    <Placemark>
  <name>pisum place test Border</name>
  <styleUrl>https://www.inaturalist.org/assets/index.kml#place</styleUrl>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>178.22570078125,-15.88631935640978 -179.0771484375,-15.88631935640978 -179.088134765625,-17.323371664099753 178.1597900390625,-17.260433005542946 178.2257080078125<U+202C>,-15.88631935640978</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark>

  </Document>
</kml>

after saving and reloading, the system didn’t like that either because it looks like it’s being interpreted as encompassing the whole rest of the world in between those lattitudes (which is wrong).

so i tried one more time by adding 360 to all longitudes, and i come back to the -180 error:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
  
  <Document>
    <Placemark>
  <name>pisum place test Border</name>
  <styleUrl>https://www.inaturalist.org/assets/index.kml#place</styleUrl>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>178.22570078125,-15.88631935640978 180.9228515625<U+202C>,-15.88631935640978 180.911865234375<U+202C>,-17.323371664099753 178.1597900390625,-17.260433005542946 178.2257080078125<U+202C>,-15.88631935640978</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark>

  </Document>
</kml>

so i agree that this is probably a bug.

i think the workaround for now is to either create 2 places or create a single multipolygon place where the first polygon stops at 180 and then other polygon picks up from there.

1 Like

Alright I tried the KML file from Google Earth and I got the same error. Far out. So frustrating. I better report it as a bug.

the title of your place in the bug report suggested that it might be entirely on the Australian mainland, which doesn’t span the antimeridian (180 deg long). but since you were still reporting that you were getting an error, i tried a couple of things. in the place page, the default map starts with the prime meridian (0 deg long) at in the middle, and the antimeridian at both the right and left sides of the map. this means that, roughly, the left side of the map includes the Americas, and the right side includes Europe, Africa, Asia, Australia.

  1. if i zoom in and to pan to the the right side of the existing map to draw a box around Brisbane (in Australia) as my place, that place is created just fine.
  2. if instead i pan to the left (thereby crossing the antimeridian and bringing Australia into view from the left side of the map) and zoom in to draw a box around Brisbane as my place, that place reports the -180 error.

so i guess this means that when you create a new place by drawing a polygon in the place page, you can’t pan across the antimeridian, even if your place doesn’t actually span the antimeridian. in other words, if you’re not spanning the antimeridian, and you’ve been doing method 2 above to create your place, try doing method 1 instead.

this still seems like a bug, but at least you should be able to easily work around it in this situation, i think.

2 Likes

FWIW this has happened to me intermittently ever since I joined mid 2018, and last happened about a week ago.

I just start again unfortunately. No adjustment or re-entering of co-ords makes any difference.

Thanks for the tips on this. I redrew the map and followed @pisum’s advice and it has worked!!!

2 Likes

@gregtasney – great. i’m glad it worked out.

@kaipatiki_naturewatc – what was the place you were trying to create? if it didn’t span the antimeridian, you should be able to successfully create it using the method described in my last post.

2 Likes

Yes that sounds a likely explanation and method! Thanks @pisum

1 Like

We are having a similar problem.
Platform is IMac, INat, last update 9 July.
We are entering a southern hemisphere reserve for the Sanctuary Mountain Maungatautari Project. Neither a KML file, nor manual entry using the polygon tool works … both return the -180 error. The KML file loads correctly into Google Earth Pro. Manual entry for a small section of the mountain confining the Southern Enclosure did load, which is very strange.
I have tried various fixes … such as going anticlockwise rather than clockwise and cutting out any peninsulas or protrusions to produce a simple polygon … can’t get it working.
Any ideas people?
Nga mihi

welcome to the forum. would you open up your kml file in a text editor and then copy and paste the text into a post here on the forum? (make sure you format the pasted text as preformatted text, using the formatting bar options.) being able to see the contents of the kml file you’re using will help others to troubleshoot your problem more easily.

I have the same problem. Sometimes everything works out, but now I have made 5 attempts and always get an error. Help please. https://cloud.mail.ru/public/2dKe/3BNr41mbe

in your case, this is what i see in your KML file:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
  
  <Document>
    <Placemark>
  <name>tumbotino Border</name>
  <styleUrl>https://www.inaturalist.org/assets/index.kml#place</styleUrl>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-317.065086364746094,56.054018451471478 -317.125511169433594,56.05363501913434 -317.162933349609375,56.031964899402091 -317.128944396972656,56.012393807696846 -317.0599365234375,56.01450489282778 -317.065086364746094,56.054018451471478</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark>

  </Document>
</kml>

note that the longitudes are -317… so just add 360 degrees:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
  
  <Document>
    <Placemark>
  <name>tumbotino Border</name>
  <styleUrl>https://www.inaturalist.org/assets/index.kml#place</styleUrl>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>42.934913635254,56.054018451471478 42.874488830567,56.05363501913434 42.837066650391,56.031964899402091 42.871055603028,56.012393807696846 42.940063476563,56.01450489282778 42.934913635254,56.054018451471478</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark>

  </Document>
</kml>

just for future reference, what was your process for creating this kml file?

I drew the territory borders on the site using the polygon tool. Then I downloaded this KML file.

Thanks! Now I understand what it is. It was a six-point test file. If I create a place with 100 points, I will need to redo all 100 points. So this is an error in the polygon tool. Can you tell me how to write to the developers of this tool? Or then I will have to look for other programs to create the KML file.

thanks for the welcome …
The file generated by ARCGIS, that were trying to use is exceeds the character limit for the this reply box.
I’ll produce a shorter version from Google Earth and post later today.
REgards
Nigel

Hi,
thanks for the welcome…
the initital KML file was too large to post into the reply box.
I have created a shorter boundary from https://www.google.com/maps/d/u/0/edit?mid=1Gf9DZVD8U5UacK27Aer7BkxkV9eBGVm7&ll=-38.02778722427921%2C175.54116075856635&z=13
and uploaded this into the Places update.
It produces the same error, that is longigured -180.
The shortened file, SMM boundary begins below.

<?xml version="1.0" encoding="UTF-8"?> Untitled layer normal #poly-000000-1200-77-nodesc-normal highlight #poly-000000-1200-77-nodesc-highlight <![CDATA[

$[name]

]]> ff000000 1.2 4d000000 <![CDATA[

$[name]

]]> ff000000 1.8 4d000000 SMM Boundary #poly-000000-1200-77-nodesc 1 175.5407316,-38.0080691,0 175.5330511,-38.0149669,0 175.5282003,-38.0201059,0 175.5269987,-38.027273,0 175.5299169,-38.0370082,0 175.5378134,-38.041605,0 175.5391867,-38.0440384,0 175.549143,-38.0462014,0 175.5517179,-38.0551231,0 175.5649359,-38.0564748,0 175.5803854,-38.0594484,0 175.5953199,-38.0490403,0 175.6102545,-38.0422809,0 175.6109411,-38.0332224,0 175.614031,-38.0214583,0 175.6052763,-38.0129382,0 175.5973799,-38.0017118,0 175.5863935,-38.0052287,0 175.5809004,-37.9987359,0 175.5577261,-37.9967067,0 175.5525762,-37.9981948,0 175.5438215,-38.0031997,0 175.5407316,-38.0080691,0

yes and no. as discussed above, the coordinates saved by the polygon tool in this case are technically valid. it’s just that the system is unexpectedly applying the -180 deg validation in some cases. although it seems that if you pan -360 deg before creating the polygon, the system will reject that polygon with the -180 deg error, it seems like if you pan -360 deg before editing the polygon, then the system will let you save it, and then you end up with your test polygon.

i think the key, really, is just to avoid panning unnecessarily. you could ask for bug fixes, but judging by the pace of development for things like this, i doubt it would be addressed any time soon.

the iNaturalist staff do monitor the forum. so they should eventually see this thread and may decide to do something about this. if you’re itching for a faster response, you could write help@inaturalist.org or you could try messaging or @mentioning one of the staff (https://www.inaturalist.org/pages/about) here on the forum.

2 Likes