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'm working with PostGIS and plotting polygons on a Google Earth plugin. I've found a few examples via Google on how to convert a LinestringM to a Polygon for rendering, but none of them, including the PostGIS docs, define very well the params for a LinestringM. Can someone identify what's happening here? Specifically, I need to know what each of the four params of LinestringM are supposed to represent.

Snippet:

....
parameters.put("wkb_geometry", "ST_MakePolygon(ST_GeomFromText('LINESTRINGM(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)'))");
....
share|improve this question

1 Answer 1

A LINESTRINGM is a linestring with three dimensions: x, y and m (measure). The LINESTRINGM in your example is wrong because it's only defined by x and y. Instead this is how it should look like:

--measured line --
SELECT ST_MakePolygon(ST_GeomFromText('LINESTRINGM(75.15 29.53 1,77 29 1,77.6 29.5 2, 75.15 29.53 2)'));

Compare: http://www.tokumine.com/postgis/

Specifically, I need to know what each of the four params of LinestringM are supposed to represent.

If I understand you correctly, you're referring to the four points that make up the line.

share|improve this answer
    
You were correct, but the implementation we were using here was unnecessarily long... Instead of the above code, we got away with just using POLYGON, eliminating the and ST_MakePolygon, ST_GeomFromText, LINESTRINGM –  Chris Cashwell May 5 '11 at 19:24

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.