Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a GeoJSON file of polygons and I need to convert it to centroids. Finding the centroid is very easy in QGIS.


My attribute names are very long and have a colon between them, e.g. building:structure and shape:elevation. Converting to centroids results in a shapefile format. It gives the geometry but changes the attribute names, truncating them and converting colons to underscores, e.g. building_l and shape_elev.

I need the attribute names in the centroids to be the same as in the original polygon.

share|improve this question

A spatial join should solve your problem. Remove any of the problematic columns in your newly created shapefile, then just join all the columns from the containing polygon.

If this doesn't work, you could also consider converting the centroid shapefile to another format that supports your attribute headers before performing the spatial join or creating a lookup table.

share|improve this answer

Your Answer


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.