timwaters / mapwarper

free open source public map georeferencer, georectifier and warper
http://mapwarper.net
MIT License
196 stars 80 forks source link

making new layer broken with georuby 2.0.0 #24

Closed timwaters closed 6 years ago

timwaters commented 11 years ago

add a -1 to from_coordinates call. as in 2.0.0 it changes the DEFAULT_SRID from -1 to 4326

self.bbox_geom = Polygon.from_coordinates([poly_array], -1)

irb(main):014:0> GeoRuby::SimpleFeatures::DEFAULT_SRID => 4326

timwaters commented 11 years ago

also in map and layers controllers

need to alter in geosearch bbox_polygon = Polygon.from_coordinates([bbox_poly_ary], -1).as_ewkt

timwaters commented 11 years ago

m.update_bbox => nil m.bbox => "29.2062390069547,-1.7214347955284,29.2844898341115,-1.64963235418521" m.save ActiveRecord::StatementInvalid: PG::Error: ERROR: new row for relation "maps" violates check constraint "enforce_srid_bbox_geom" : UPDATE "maps" SET "bbox_geom" = '0103000020E61000000100000005000000AB075E14CC343D40D8DA4F36FF8AFBBFA78D6553D4483D40D8DA4F36FF8AFBBFA78D6553D4483D4031623AE5E464FABFAB075E14CC343D4031623AE5E464FABFAB075E14CC343D40D8DA4F36FF8AFBBF', "bbox" = E'29.2062390069547,-1.7214347955284,29.2844898341115,-1.64963235418521', "updated_at" = '2012-12-11 19:39:00.860087' WHERE "id" = 759