-
Notifications
You must be signed in to change notification settings - Fork 31
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
Problem when try to return a Polygon from database #46
Comments
Alou quase xará! 'Marcos' aqui... Vou testar essa parada! Tva vendo o findshop teu, manero! Se tu quiser ligar por cidades da uma olhada na gem |
Olá @nofxx, obrigado pelo seu email! Legal saber que brasileiro toca essa gem. Parabéns! Ontem eu fiz um fork, e mudando o demongoize acabou quebrando alguns testes, mas para minha necessidade não tem problemas. Vou alterar para spatial. Havia tentado inicialmente assim, mas por algum motivo que não me lembro agora, mudei para sphere. Quanto ao findshop, é uma idéia antiga, que não estou mais mexendo, mas obrigado pela dica. Vi seu repo e tem bastante coisa interessante. Depois vou dar uma fuçada. Se puder contribuir com alguma coisa ai, por favor, avise-me, ok? Abraços e obrigado, |
Alou Marco, Cara, fui ver os docs, agora ñ entendi se mudou ou se sempre teve errado,,. E agora José? hehe, amanhã vejo com calma. Sono... |
Just cleaning up old issues. What should we do with this? |
I need to review this, did mongodb changed or the implementation was never correct?
|
Having the same issue with a different error, because
creating an area
removing
|
@tedma4 you should never have to write the full hash:
To my understanding, the polygon is only a index thing, field should be Array, not Hash. |
This spec shows the reasons why the reported exception in mongoid#46 gets thrown.
@nofxx Why are you using three level of arrays? why not use this instead: area = Area.new(area_profile: [[0, 0], [3, 6], [6, 1], [0, 0]]) for me works fine if I use one array and inside arrays with coordinates The thing here is if I use two level of array the Polygon methods works fine for example area.area_profile.center works well, but if I use three level of arrays this throws the exception TypeError: no implicit conversion of Hash into Integer. But if we use two level of arrays then if I try to query something using polygons this throws Mongo::Error::OperationFailure: GeoJSON coordinates must be an array (2) for example using :loc.within_polygon |
the model
creating an area
On MongoDB
Executing on rails c
I changed the line 86 of geometry_field.rb from:
to
And apparently worked.
Question: Why we have the '&& new(obj)'?
Thank you,
Marco.
The text was updated successfully, but these errors were encountered: