Last active
December 27, 2015 09:58
-
-
Save GusGA/7307222 to your computer and use it in GitHub Desktop.
Método de clase para generar el contenido con formato geojson para crear puntos en el mapa
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
def self.to_geojson | |
{ type: "FeatureCollection", | |
features: | |
self.all.map do |local| | |
{ | |
type: "Feature", | |
geometry: { type: "Point", coordinates: local.coordinates}, | |
id: local.id, | |
properties: { prop1: local.val1, | |
prop2: local.val2, | |
prop3: local.val3, | |
prop4: local.val4 | |
} | |
} | |
end | |
} | |
end | |
# según las especificaciones de http://geojson.org/geojson-spec.html#point |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment