Created
September 25, 2010 16:39
-
-
Save guilleiguaran/597030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indices = res.result | |
ruta = [] | |
indices.each do |fila| | |
id = fila[0] | |
res = @@pgconn.exec "SELECT ST_AsText(the_geom) as texto FROM vertices_tmp WHERE id = #{id};" | |
coord = [ res.result[0][0].gsub("POINT(","").gsub(")","").split(" ")[1].to_f, | |
res.result[0][0].gsub("POINT(","").gsub(")","").split(" ")[0].to_f ] | |
ruta << coord | |
end | |
ruta.to_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment