Return to Project-GC

Welcome to Project-GC Q&A. Ask questions and get answers from other Project-GC users.

If you get a good answer, click the checkbox on the left to select it as the best answer.

Upvote answers or questions that have helped you.

If you don't get clear answers, edit your question to make it clearer.

+4 votes
1.3k views
There is a strange bug when it comes to Spanish provinces.

As second level geographical units in Spain PGC uses the Comunidades autónomas. As third level units the provinces.

Thus, there is a second level unit "Comunidad de Madrid", which is fine. However, this contains two third level units, namely "Comunidad de Madrid" and "Segovia". There is the bug. Firstly, the province of Segovia is part of the Comunidad autónoma de Castilla y León (and is also correctly enumerated there as well). It should, therefore, not appear as subunit of "Comunidad de Madrid". Secondly, the "Comunidad de Madrid" in reality contains only one third level unit = province, and this should be called simply "Madrid".

This problem is consistently present within PGC, whether it is geographical filtering or the maps in the statistics, which for "Comunidad de Madrid" also show next to the province of Madrid also the province of Segovia not belonging here.
in Bug reports by k+gw+a (12.6k points)
The geographic data is gathered from OSM so it is most probably wrong there. That is also the place where it should be fixed in the first place if you have the knowledge what is correct.
As far as I can see OSM is correct there. Of course, as the Comunidad de Madrid contains only one province, namely the province of Madrid, the border in OSM lables it as "Comunidad de Madrid". Which is correct, of course, only that at the lower level ("county" level in PGC) the same entity should just be called Madrid.
It is also striking that if you look at the overall map of Spain in PGC the borders are correct, and only if you click on "Comunidad de Madrid" the map gets wrong, showing also the province of Segovia, which does not belong there.
Thirdly, the names of different entities do not always seem to be taken from OSM. In Belgium e.g. there is the strange situation that what should be called "Bruxelles - Capitale / Brussel - Hoofdstad" is called "Brussels" in PGC, being the only exception of using the English name rather than the official local one, as is the case with all other provinces. And this is certainly not due to some error in OSM.

1 Answer

+1 vote
 
Best answer

I am currently working on updating Spain to the latest OSM-data. I can not figure out what the problem here is though.

"Thus, there is a second level unit "Comunidad de Madrid", which is fine. However, this contains two third level units, namely "Comunidad de Madrid" and "Segovia". There is the bug."

The region Comunidad de Madrid only has one county in it according to Project-GC, it has the same name, Comunidad de Madrid.

Firstly, the province of Segovia is part of the Comunidad autónoma de Castilla y León (and is also correctly enumerated there as well). It should, therefore, not appear as subunit of "Comunidad de Madrid". 

Segovia is a part of Castilla y León, just as you say it is. It is not a part of Madrid.

Secondly, the "Comunidad de Madrid" in reality contains only one third level unit = province, and this should be called simply "Madrid".

I assume you mean that the county Comunidad de Madrid should not have the same name as the region Comunidad de Madrid. It's however named Comunidad de Madrid in OpenStreetMap as well.

On a more technical level. Project-GC doesn't really have any connection where county X belongs to region Y. It calculates which region and county a geocache belongs to by looking at the geocache's coordinates and the polygon data we have. That could very well end up with a geocache belonging to region Madrid and county Ceuta, depending on how the polygon data look.

As a postprocessing job Project-GC also goes through its data on a daily basis. If 95% of the geocaches in county Ceuta belongs to region Ceuta and 5% to region Madrid, it will update the the cache data to have region Ceuta on all of them. This can create temporary glitches. This is however only an issue if the polygon data doesn't have the same border for regions and counties. Madrid/Ceuta is an extreme case that probably wouldn't happen. But for two neighboring polygons there are high risks of complications close to the borders.

by magma1447 (Admin) (243k points)
selected by k+gw+a
Good afternoon and thanks a lot for your reaction.

I am not sure whether this is a problem only I have, but when I go to the "maps" section in Profile stats (http://project-gc.com/Profile/ProfileStats#Maps) and select, when it comes to Spain, Comunidad de Madrid, the map on my screen shows the province of Madrid in green. It shows surrounding provinces in grey, because they don’t belong to the Comunidad de Madrid. However, it shows the province of Segovia in white as if it belonged to the Comunidad de Madrid and I hadn’t found any caches there. Both is incorrect. So, the province of Segovia should be grey, and the map should not be drawn in a way to have space for the province of Segovia as well. (It should extend from N 39° 51’ to N 41° 10’.)

When I originally posted my request, in the geographical menus – e.g. http://project-gc.com/Tools/MapCompare?profile_name=k%2Bgw%2Ba&country=Spain&region=Comunidad+de+Madrid&county=Comunidad+de+Madrid&nonefound=on&onefound=on&showdisabled=on&showarchived=on&submit=Filter – there were two third level units ("counties") in the Comunidad de Madrid, namely "Comunidad de Madrid" and "Segovia". The latter was wrong, but is no longer shown, so this has been corrected in the meantime.

As for the name question, I don’t think it’s a question of polygons (I haven’t seen any irregularities there). The polgyon for Comunidad de Madrid should be exactly the same as for the province of Madrid. It just should be named "Comunidad de Madrid" as a region, but "Madrid" as a province (="county" on Project-GC).

There is another strange thing with the Spain map in Profile stats (http://project-gc.com/Profile/ProfileStats#Maps): until today, when I looked at the map according to regions it ended just south of the Canary Islands. However, looking at it according to counties, it extended further south to show also most of western Africa - which is superfluous and just makes Spain smaller. Interestingly enough, as of today this map inlcuding western Africa is also shown for the regions.
(A couple of months ago, the Canary Islands were simply not shown and Spain ended south of mainland Spain. The preferred option in my opinion is to include the Canary Islands but limit the map there, i.e. at N 27°, rather than extending it south to N 7° as it is now - maybe this is just a typo?)

Thanks so much for all your effort - I hope my question is a bit clearer now.
A fast answer before I dig deeper.

About the Madrid county name. We call it Comunidad de Madrid, because it's named that in admin level 6 in OSM.

The maps in Profile stats have dynamic bounding boxes created from active traditional geocaches in the country. For some countries we have made exceptions with hard coded bounding boxes. This might be a solution we should use for Spain as well.
Also if select boxes has shown Segovia as a subpart of Madrid, that is because of geocaches matching region Madrid and county Segovia. Likely to be very close to the borders.

This will fix itself (which it obviously has) as explained above.
There is a Profile stats map image of Madrid on our CDN that indeed has a white polygon for the neighbor. That is old data due to the side effects mentioned.

The latest version looks like this and will end up in your stats soon:
http://project-gc.com/images/ps_map.php?mapHash=5d6ffc4e2ead378341fba17f28661b1d

I have also made changes to the bounding box so Africa won't be included. Nothing below latitude 36 will be accounted for. The problem is that someone has created (and someone has published) a Traditional cache in Ghana with country Spain, GC6V6QT. Project-GC has been tricked in believing Spain is bigger than it is by being provided faulty data.
Perfect and extremely quick – as usual. You are simply great. Thanks a lot for the corrections and the explanations. It’s very interesting to know the background why some things happen which to the layman just look like bizarre behaviour.
Just a small additional comment: limiting Spain to latitude 36 would, however, cut out the Canary Islands. I found it nice that they were included in the map. So cutting at latitude 27 would, in my opinion, be ideal.
I'll move it to 27. The better solution would be like GSAK/Findstatgen does it, a "zoom-box" with the smaller parts. We have a bit too much automagix for that though. Maybe in the future.
Great, thanks a lot. I think with N 27 it still leaves mainland Spain big enough to be able to see the provinces nicely.
...