-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create a polygon #235
Comments
An Update: Apparently the Polygon was invalid when I checked it with IsValidDetail(), so I corrected it with MakeValid() function. I then ensured that there are no repeating points, and that the opening point is identical to the closing point. But sadly it still wouldn't accept the polygon
|
Same issue #85, I had to run ST_Simplify to make postgis adapter accept the polygon. |
@slavajacobson Did you find a way to get this working from the Ruby side? I'm currently having trouble doing a really basic INSERT: wkt = "POLYGON ((-74.2503655987721 40.5091442241349, -74.2504120352793 40.5091183000754, -74.2503322759711 40.5090405104492))"
Geometry.new.tap do |g|
g.shape = wkt
g.save!
end
# ActiveRecord::StatementInvalid:
# PG::InvalidTextRepresentation: ERROR: invalid input syntax for type polygon: "POLYGON ((-74.2503655987721 40.5091442241349, -74.2504120352793 40.5091183000754, -74.2503322759711 40.5090405104492))"
# : INSERT INTO "geometries" ("shape") VALUES ($1) RETURNING "id" On the SQL side, I can add INSERT INTO "geometries" ("shape") VALUES (ST_GeomFromText('POLYGON((-74.2503655987721 40.5091442241349, -74.2504120352793 40.5091183000754, -74.2503322759711 40.5090405104492))', 4326)::polygon);
# INSERT 0 1 |
@slavajacobson @delner It would be helpful if could please provide an update on this. My workaround now is to use ST_Simplify. |
Depending on the factory being used, there may be floating point issues, specifically the To parse invalid polygons, use a factory that has |
@keithdoggett is it possible to enable |
@andrerigon no, not directly. You have to use the |
polygon ends up being nil;
I have tested the syntax directly in psql and it seems to work:
No syntax errors. Result: http://bl.ocks.org/d/86fd2eaf2ee1528d865eb47c05c37784
Does anybody know why this doesn't work with postgis adapter?
The text was updated successfully, but these errors were encountered: