Ksym
Ksym

Reputation: 101

How to properly set points to polygon PostGis?

How to properly set points to Polygon i'm trying

  INSERT INTO "geo"("geometry")VALUES(ST_AsHEXEWKB(ST_GeomFromText('POLYGON((50.1033 26.4344,49.75 24,50.1033 26.4344))',4326))); 

but had error: <-- parse error at position 57 within geometry;

when i set points from example all works. How to fix it?

Upvotes: 0

Views: 197

Answers (1)

user3307073
user3307073

Reputation:

If you got your polygon vertices coordinates, you may simply do: INSERT INTO {yourTableName} ({yourGeometryColumnName}) VALUES (ST_GeomFromText('POLYGON(({x1} {y1}, {x2} {y2}, ...))'))

Upvotes: 1

Related Questions