Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 try to create a line with two points. These points are obtained in a SHP layer.

How can i convert that points to decimals?

Thank you

share|improve this question
Could you clarify what you are looking for? After all, converting a (geometric) point into a "decimal" makes no sense on the face of it. Are you asking, perhaps, for a base-ten decimal representation of point coordinates to be output? (If so, what does that have to do with creating a line [segment] from two points?) – whuber May 20 '13 at 12:50
I take two points from shapefine and I want to create a line with QgsVectorLayer. I need points in decimals to the function QgsGeometry.fromPolyline – user1573901 May 20 '13 at 13:46

This functionality is covered in "Points2One" and "Points to Paths" plugins. You can take code from there.

share|improve this answer
How can take code from these two plugins? – user1573901 May 20 '13 at 13:03
I found: geom.asPoint().x() or y() Thank you – user1573901 May 20 '13 at 14:01

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.