Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I was wondering if anyone could shed a light on why this behavior is happening in QGIS ? alt text

I'm pretty confident that the issue here is not due to "centroids within polygon"

Edit

Added a detailed image alt text

share|improve this question
    
is there multipolygons or geometry collections that might be spread from eachother. as it looks, that explanation would not make sense if the image show the whole dataset though. –  Nicklas Avén Nov 18 '10 at 20:16
    
@Nicklas Avén - I just added another image –  dassouki Nov 18 '10 at 20:25
4  
It looks like a projection issue to me. Does the polygon layer have a projection defined? Can you provide more detail on the projection of the polygon layer, the projection for the QGIS data frame, whether you have 'On the fly reprojection' turned on? –  Sean Nov 18 '10 at 20:47
    
Could you share a data sample? –  underdark Nov 19 '10 at 8:20
    
@Sean - that was totally it, if you can put it into an answer, I'll be glad to accept it –  dassouki Nov 22 '10 at 15:10
add comment

2 Answers

up vote 3 down vote accepted

QGIS does not reproject data on the fly automatically. It's not unusual to have a Coordinate Reference System (CRS) defined for a project and have data added to the map with a different projection that displays but has not been transformed to the CRS of the map. If the CRS of the map and the CRS of the data are close enough, the data will display but be in a slightly different position.

Your centroids and polygons are in different CRSs. The solution is to either:

  • project one of the datasets into the same CRS as the other or
  • check the "Enable 'on the fly' CRS transformation" box on Coordinate Reference System (CRS) tab of the Project Properties window.

Be aware that the second option does not affect your data, it only projects it for the display. The underlying data is not changed.

share|improve this answer
add comment

You just need a new QGis plugin to create polygon centroids, you can check out "Centroid Maker" from here

edit: It is more efficient/accurate for the problem of "island" geometries, which confuses traditional centroids makers.

share|improve this answer
    
how is it different, better, or worse than the QGIS one (aka cfarmer's one)? –  dassouki Nov 19 '10 at 14:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.