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 have a GeoJSON file of polygons and I need to convert it to centroids. Finding the centroid is very easy in QGIS.

Problem

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

1 Answer 1

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

 
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.