Discussion:
Index on GEOJSON field
(too old to reply)
Stefano Passiatore
2013-04-25 07:40:59 UTC
Permalink
Hi to all, I've this filed in my document:

{"geometry" : { "type" : "Polygon", "coordinates" :[[[7.282782, 44.61294],
[7.283935, 44.61293], [7.286837, 44.611853], [7.287715, 44.611461],
[7.288526, 44.610983], [7.295425, 44.606333], [7.300007, 44.603012],
[7.300558, 44.602718], [7.302949, 44.601647], [7.304067, 44.601344],
[7.3086, 44.600466], [7.310826, 44.60021], [7.311634, 44.600195],
[7.312773, 44.600203], [7.31373, 44.600258], [7.314291, 44.600316],
[7.315784, 44.60086], [7.321178, 44.60314], [7.321289, 44.603223],
[7.32139, 44.603319], [7.32165, 44.603651], [7.322174, 44.604339],
[7.326342, 44.603108], [7.326698, 44.602888], [7.328, 44.60225], [7.328368,
44.602076], [7.32888, 44.601885], [7.339799, 44.598299], [7.341376,
44.598174], [7.342134, 44.598117], [7.342739, 44.598126], [7.348733,
44.598306], [7.351195, 44.592361], [7.351943, 44.591413], [7.353902,
44.589155], [7.354039, 44.589058], [7.355697, 44.587907], [7.357086,
44.586982], [7.359394, 44.585768], [7.376656, 44.580595], [7.383961,
44.578615], [7.38535, 44.578423], [7.383638, 44.577953], [7.383327,
44.577841], [7.382396, 44.577341], [7.381946, 44.575868], [7.381501,
44.573746], [7.380966, 44.569408], [7.381147, 44.568781], [7.38128,
44.567612], [7.381304, 44.567198], [7.38127, 44.567081], [7.3809,
44.565878], [7.380793, 44.565679], [7.380759, 44.565629], [7.380648,
44.565461], [7.380296, 44.564952], [7.374248, 44.55788], [7.372901,
44.557861], [7.37255, 44.55782], [7.372336, 44.55779], [7.372077,
44.557624], [7.371188, 44.556999], [7.371028, 44.556844], [7.366489,
44.549433], [7.366203, 44.548871], [7.366075, 44.548491], [7.366018,
44.548256], [7.365865, 44.53778], [7.366244, 44.536601], [7.36549,
44.536775], [7.365408, 44.536796], [7.361493, 44.540386], [7.361232,
44.540706], [7.36116, 44.541038], [7.361304, 44.541743], [7.361403,
44.542257], [7.360399, 44.545938], [7.354438, 44.549539], [7.345313,
44.553926], [7.342703, 44.554933], [7.343596, 44.557867], [7.34742,
44.558791], [7.347775, 44.558891], [7.348122, 44.559031], [7.350721,
44.560482], [7.351205, 44.560808], [7.351473, 44.561492], [7.35163,
44.561985], [7.351155, 44.562437], [7.350743, 44.56271], [7.343885,
44.566819], [7.329611, 44.574551], [7.32569, 44.57624], [7.32096,
44.57771], [7.313023, 44.579704], [7.310811, 44.580113], [7.310414,
44.58017], [7.308875, 44.580215], [7.307107, 44.579635], [7.306834,
44.579617], [7.306584, 44.579605], [7.30631, 44.579623], [7.305864,
44.579724], [7.303958, 44.580187], [7.301737, 44.580892], [7.30132,
44.581286], [7.294473, 44.582476], [7.285745, 44.587211], [7.279721,
44.591032], [7.279485, 44.591172], [7.279152, 44.591343], [7.278986,
44.591408], [7.276883, 44.591565], [7.271547, 44.591728], [7.268992,
44.59168], [7.266041, 44.591361], [7.265591, 44.591358], [7.265026,
44.591422], [7.263705, 44.591586], [7.260174, 44.592383], [7.25983,
44.592504], [7.259575, 44.592595], [7.259229, 44.592774], [7.259351,
44.593046], [7.259576, 44.593418], [7.267426, 44.599461], [7.267864,
44.599805], [7.268139, 44.600098], [7.273074, 44.610057], [7.273391,
44.610782], [7.274251, 44.612811], [7.274412, 44.613394], [7.274326,
44.615935], [7.282782, 44.61294]]]}

but when I try to create index with:

db.cities.ensureIndex({ "geometry.coordinates" : "2d"})

I got this error:

"err" : "geo values have to be numbers :: caused by :: { NOME_COM:
\"Brossasco\", COD_REG: 1, COD_PRO: 4, geometry: { type: \"Polygon\",
coordinates: [ [ [ 7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [
7.286837, 44.611853 ], [ 7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [
7.295425, 44.606333 ], [ 7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [
7.302949, 44.601647 ], [ 7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [
7.310826, 44.60021 ], [ 7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [
7.31373, 44.600258 ], [ 7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [
7.321178, 44.60314 ], [ 7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [
7.32165, 44.603651 ], [ 7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [
7.326698, 44.602888 ], [ 7.328, 44.60225 ], [ 7.328368, 44.602076 ], [
7.32888, 44.601885 ], [ 7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [
7.342134, 44.598117 ], [ 7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [
7.351195, 44.592361 ], [ 7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [
7.354039, 44.589058 ], [ 7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [
7.359394, 44.585768 ], [ 7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [
7.38535, 44.578423 ], [ 7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [
7.382396, 44.577341 ], [ 7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [
7.380966, 44.569408 ], [ 7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [
7.381304, 44.567198 ], [ 7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [
7.380793, 44.565679 ], [ 7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [
7.380296, 44.564952 ], [ 7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [
7.37255, 44.55782 ], [ 7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [
7.371188, 44.556999 ], [ 7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [
7.366203, 44.548871 ], [ 7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [
7.365865, 44.53778 ], [ 7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [
7.365408, 44.536796 ], [ 7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [
7.36116, 44.541038 ], [ 7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [
7.360399, 44.545938 ], [ 7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [
7.342703, 44.554933 ], [ 7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [
7.347775, 44.558891 ], [ 7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [
7.351205, 44.560808 ], [ 7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [
7.351155, 44.562437 ], [ 7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [
7.329611, 44.574551 ], [ 7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [
7.313023, 44.579704 ], [ 7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [
7.308875, 44.580215 ], [ 7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [
7.306584, 44.579605 ], [ 7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [
7.303958, 44.580187 ], [ 7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [
7.294473, 44.582476 ], [ 7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [
7.279485, 44.591172 ], [ 7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [
7.276883, 44.591565 ], [ 7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [
7.266041, 44.591361 ], [ 7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [
7.263705, 44.591586 ], [ 7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [
7.259575, 44.592595 ], [ 7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [
7.259576, 44.593418 ], [ 7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [
7.268139, 44.600098 ], [ 7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [
7.274251, 44.612811 ], [ 7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [
7.282782, 44.61294 ] ] ] }, _id: ObjectId('5178dda27cad6ae806000001') }",

"code" : 13026,

"n" : 0,

"connectionId" : 1,

"ok" : 1

Where is the problem???

thanks a lot

Stefano
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Rob Moore
2013-04-26 01:01:11 UTC
Permalink
You can not use GeoJSON with the '2d' index. See the second bullet on:
http://docs.mongodb.org/manual/core/2d/.

You will need to use the '2dsphere' index:
http://docs.mongodb.org/manual/core/2dsphere/

db.cities.ensureIndex({ "geometry.coordinates" : "2dsphere"})

Rob.
Post by Stefano Passiatore
{"geometry" : { "type" : "Polygon", "coordinates" :[[[7.282782,
44.61294], [7.283935, 44.61293], [7.286837, 44.611853], [7.287715,
44.611461], [7.288526, 44.610983], [7.295425, 44.606333], [7.300007,
44.603012], [7.300558, 44.602718], [7.302949, 44.601647], [7.304067,
44.601344], [7.3086, 44.600466], [7.310826, 44.60021], [7.311634,
44.600195], [7.312773, 44.600203], [7.31373, 44.600258], [7.314291,
44.600316], [7.315784, 44.60086], [7.321178, 44.60314], [7.321289,
44.603223], [7.32139, 44.603319], [7.32165, 44.603651], [7.322174,
44.604339], [7.326342, 44.603108], [7.326698, 44.602888], [7.328,
44.60225], [7.328368, 44.602076], [7.32888, 44.601885], [7.339799,
44.598299], [7.341376, 44.598174], [7.342134, 44.598117], [7.342739,
44.598126], [7.348733, 44.598306], [7.351195, 44.592361], [7.351943,
44.591413], [7.353902, 44.589155], [7.354039, 44.589058], [7.355697,
44.587907], [7.357086, 44.586982], [7.359394, 44.585768], [7.376656,
44.580595], [7.383961, 44.578615], [7.38535, 44.578423], [7.383638,
44.577953], [7.383327, 44.577841], [7.382396, 44.577341], [7.381946,
44.575868], [7.381501, 44.573746], [7.380966, 44.569408], [7.381147,
44.568781], [7.38128, 44.567612], [7.381304, 44.567198], [7.38127,
44.567081], [7.3809, 44.565878], [7.380793, 44.565679], [7.380759,
44.565629], [7.380648, 44.565461], [7.380296, 44.564952], [7.374248,
44.55788], [7.372901, 44.557861], [7.37255, 44.55782], [7.372336,
44.55779], [7.372077, 44.557624], [7.371188, 44.556999], [7.371028,
44.556844], [7.366489, 44.549433], [7.366203, 44.548871], [7.366075,
44.548491], [7.366018, 44.548256], [7.365865, 44.53778], [7.366244,
44.536601], [7.36549, 44.536775], [7.365408, 44.536796], [7.361493,
44.540386], [7.361232, 44.540706], [7.36116, 44.541038], [7.361304,
44.541743], [7.361403, 44.542257], [7.360399, 44.545938], [7.354438,
44.549539], [7.345313, 44.553926], [7.342703, 44.554933], [7.343596,
44.557867], [7.34742, 44.558791], [7.347775, 44.558891], [7.348122,
44.559031], [7.350721, 44.560482], [7.351205, 44.560808], [7.351473,
44.561492], [7.35163, 44.561985], [7.351155, 44.562437], [7.350743,
44.56271], [7.343885, 44.566819], [7.329611, 44.574551], [7.32569,
44.57624], [7.32096, 44.57771], [7.313023, 44.579704], [7.310811,
44.580113], [7.310414, 44.58017], [7.308875, 44.580215], [7.307107,
44.579635], [7.306834, 44.579617], [7.306584, 44.579605], [7.30631,
44.579623], [7.305864, 44.579724], [7.303958, 44.580187], [7.301737,
44.580892], [7.30132, 44.581286], [7.294473, 44.582476], [7.285745,
44.587211], [7.279721, 44.591032], [7.279485, 44.591172], [7.279152,
44.591343], [7.278986, 44.591408], [7.276883, 44.591565], [7.271547,
44.591728], [7.268992, 44.59168], [7.266041, 44.591361], [7.265591,
44.591358], [7.265026, 44.591422], [7.263705, 44.591586], [7.260174,
44.592383], [7.25983, 44.592504], [7.259575, 44.592595], [7.259229,
44.592774], [7.259351, 44.593046], [7.259576, 44.593418], [7.267426,
44.599461], [7.267864, 44.599805], [7.268139, 44.600098], [7.273074,
44.610057], [7.273391, 44.610782], [7.274251, 44.612811], [7.274412,
44.613394], [7.274326, 44.615935], [7.282782, 44.61294]]]}
db.cities.ensureIndex({ "geometry.coordinates" : "2d"})
\"Brossasco\", COD_REG: 1, COD_PRO: 4, geometry: { type: \"Polygon\",
coordinates: [ [ [ 7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [
7.286837, 44.611853 ], [ 7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [
7.295425, 44.606333 ], [ 7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [
7.302949, 44.601647 ], [ 7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [
7.310826, 44.60021 ], [ 7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [
7.31373, 44.600258 ], [ 7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [
7.321178, 44.60314 ], [ 7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [
7.32165, 44.603651 ], [ 7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [
7.326698, 44.602888 ], [ 7.328, 44.60225 ], [ 7.328368, 44.602076 ], [
7.32888, 44.601885 ], [ 7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [
7.342134, 44.598117 ], [ 7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [
7.351195, 44.592361 ], [ 7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [
7.354039, 44.589058 ], [ 7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [
7.359394, 44.585768 ], [ 7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [
7.38535, 44.578423 ], [ 7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [
7.382396, 44.577341 ], [ 7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [
7.380966, 44.569408 ], [ 7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [
7.381304, 44.567198 ], [ 7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [
7.380793, 44.565679 ], [ 7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [
7.380296, 44.564952 ], [ 7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [
7.37255, 44.55782 ], [ 7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [
7.371188, 44.556999 ], [ 7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [
7.366203, 44.548871 ], [ 7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [
7.365865, 44.53778 ], [ 7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [
7.365408, 44.536796 ], [ 7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [
7.36116, 44.541038 ], [ 7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [
7.360399, 44.545938 ], [ 7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [
7.342703, 44.554933 ], [ 7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [
7.347775, 44.558891 ], [ 7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [
7.351205, 44.560808 ], [ 7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [
7.351155, 44.562437 ], [ 7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [
7.329611, 44.574551 ], [ 7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [
7.313023, 44.579704 ], [ 7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [
7.308875, 44.580215 ], [ 7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [
7.306584, 44.579605 ], [ 7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [
7.303958, 44.580187 ], [ 7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [
7.294473, 44.582476 ], [ 7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [
7.279485, 44.591172 ], [ 7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [
7.276883, 44.591565 ], [ 7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [
7.266041, 44.591361 ], [ 7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [
7.263705, 44.591586 ], [ 7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [
7.259575, 44.592595 ], [ 7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [
7.259576, 44.593418 ], [ 7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [
7.268139, 44.600098 ], [ 7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [
7.274251, 44.612811 ], [ 7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [
7.282782, 44.61294 ] ] ] }, _id: ObjectId('5178dda27cad6ae806000001') }",
"code" : 13026,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem???
thanks a lot
Stefano
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Stefano Passiatore
2013-04-26 16:54:08 UTC
Permalink
Hi Rob, with 2dsphere index I got this error:

"err" : "Can't extract geo keys from object, malformed geometry?:{ 0: [ [
7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [ 7.286837, 44.611853 ], [
7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [ 7.295425, 44.606333 ], [
7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [ 7.302949, 44.601647 ], [
7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [ 7.310826, 44.60021 ], [
7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [ 7.31373, 44.600258 ], [
7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [ 7.321178, 44.60314 ], [
7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [ 7.32165, 44.603651 ], [
7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [ 7.326698, 44.602888 ], [
7.328, 44.60225 ], [ 7.328368, 44.602076 ], [ 7.32888, 44.601885 ], [
7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [ 7.342134, 44.598117 ], [
7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [ 7.351195, 44.592361 ], [
7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [ 7.354039, 44.589058 ], [
7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [ 7.359394, 44.585768 ], [
7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [ 7.38535, 44.578423 ], [
7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [ 7.382396, 44.577341 ], [
7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [ 7.380966, 44.569408 ], [
7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [ 7.381304, 44.567198 ], [
7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [ 7.380793, 44.565679 ], [
7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [ 7.380296, 44.564952 ], [
7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [ 7.37255, 44.55782 ], [
7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [ 7.371188, 44.556999 ], [
7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [ 7.366203, 44.548871 ], [
7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [ 7.365865, 44.53778 ], [
7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [ 7.365408, 44.536796 ], [
7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [ 7.36116, 44.541038 ], [
7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [ 7.360399, 44.545938 ], [
7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [ 7.342703, 44.554933 ], [
7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [ 7.347775, 44.558891 ], [
7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [ 7.351205, 44.560808 ], [
7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [ 7.351155, 44.562437 ], [
7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [ 7.329611, 44.574551 ], [
7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [ 7.313023, 44.579704 ], [
7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [ 7.308875, 44.580215 ], [
7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [ 7.306584, 44.579605 ], [
7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [ 7.303958, 44.580187 ], [
7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [ 7.294473, 44.582476 ], [
7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [ 7.279485, 44.591172 ], [
7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [ 7.276883, 44.591565 ], [
7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [ 7.266041, 44.591361 ], [
7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [ 7.263705, 44.591586 ], [
7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [ 7.259575, 44.592595 ], [
7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [ 7.259576, 44.593418 ], [
7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [ 7.268139, 44.600098 ], [
7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [ 7.274251, 44.612811 ], [
7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [ 7.282782, 44.61294 ] ] }",
"code" : 16572,
"n" : 0,
"connectionId" : 1,
"ok" : 1

Where is the problem!?!?
Thanks a lot!
Stefano
Post by Rob Moore
http://docs.mongodb.org/manual/core/2d/.
http://docs.mongodb.org/manual/core/2dsphere/
db.cities.ensureIndex({ "geometry.coordinates" : "2dsphere"})
Rob.
Post by Stefano Passiatore
{"geometry" : { "type" : "Polygon", "coordinates" :[[[7.282782,
44.61294], [7.283935, 44.61293], [7.286837, 44.611853], [7.287715,
44.611461], [7.288526, 44.610983], [7.295425, 44.606333], [7.300007,
44.603012], [7.300558, 44.602718], [7.302949, 44.601647], [7.304067,
44.601344], [7.3086, 44.600466], [7.310826, 44.60021], [7.311634,
44.600195], [7.312773, 44.600203], [7.31373, 44.600258], [7.314291,
44.600316], [7.315784, 44.60086], [7.321178, 44.60314], [7.321289,
44.603223], [7.32139, 44.603319], [7.32165, 44.603651], [7.322174,
44.604339], [7.326342, 44.603108], [7.326698, 44.602888], [7.328,
44.60225], [7.328368, 44.602076], [7.32888, 44.601885], [7.339799,
44.598299], [7.341376, 44.598174], [7.342134, 44.598117], [7.342739,
44.598126], [7.348733, 44.598306], [7.351195, 44.592361], [7.351943,
44.591413], [7.353902, 44.589155], [7.354039, 44.589058], [7.355697,
44.587907], [7.357086, 44.586982], [7.359394, 44.585768], [7.376656,
44.580595], [7.383961, 44.578615], [7.38535, 44.578423], [7.383638,
44.577953], [7.383327, 44.577841], [7.382396, 44.577341], [7.381946,
44.575868], [7.381501, 44.573746], [7.380966, 44.569408], [7.381147,
44.568781], [7.38128, 44.567612], [7.381304, 44.567198], [7.38127,
44.567081], [7.3809, 44.565878], [7.380793, 44.565679], [7.380759,
44.565629], [7.380648, 44.565461], [7.380296, 44.564952], [7.374248,
44.55788], [7.372901, 44.557861], [7.37255, 44.55782], [7.372336,
44.55779], [7.372077, 44.557624], [7.371188, 44.556999], [7.371028,
44.556844], [7.366489, 44.549433], [7.366203, 44.548871], [7.366075,
44.548491], [7.366018, 44.548256], [7.365865, 44.53778], [7.366244,
44.536601], [7.36549, 44.536775], [7.365408, 44.536796], [7.361493,
44.540386], [7.361232, 44.540706], [7.36116, 44.541038], [7.361304,
44.541743], [7.361403, 44.542257], [7.360399, 44.545938], [7.354438,
44.549539], [7.345313, 44.553926], [7.342703, 44.554933], [7.343596,
44.557867], [7.34742, 44.558791], [7.347775, 44.558891], [7.348122,
44.559031], [7.350721, 44.560482], [7.351205, 44.560808], [7.351473,
44.561492], [7.35163, 44.561985], [7.351155, 44.562437], [7.350743,
44.56271], [7.343885, 44.566819], [7.329611, 44.574551], [7.32569,
44.57624], [7.32096, 44.57771], [7.313023, 44.579704], [7.310811,
44.580113], [7.310414, 44.58017], [7.308875, 44.580215], [7.307107,
44.579635], [7.306834, 44.579617], [7.306584, 44.579605], [7.30631,
44.579623], [7.305864, 44.579724], [7.303958, 44.580187], [7.301737,
44.580892], [7.30132, 44.581286], [7.294473, 44.582476], [7.285745,
44.587211], [7.279721, 44.591032], [7.279485, 44.591172], [7.279152,
44.591343], [7.278986, 44.591408], [7.276883, 44.591565], [7.271547,
44.591728], [7.268992, 44.59168], [7.266041, 44.591361], [7.265591,
44.591358], [7.265026, 44.591422], [7.263705, 44.591586], [7.260174,
44.592383], [7.25983, 44.592504], [7.259575, 44.592595], [7.259229,
44.592774], [7.259351, 44.593046], [7.259576, 44.593418], [7.267426,
44.599461], [7.267864, 44.599805], [7.268139, 44.600098], [7.273074,
44.610057], [7.273391, 44.610782], [7.274251, 44.612811], [7.274412,
44.613394], [7.274326, 44.615935], [7.282782, 44.61294]]]}
db.cities.ensureIndex({ "geometry.coordinates" : "2d"})
\"Brossasco\", COD_REG: 1, COD_PRO: 4, geometry: { type: \"Polygon\",
coordinates: [ [ [ 7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [
7.286837, 44.611853 ], [ 7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [
7.295425, 44.606333 ], [ 7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [
7.302949, 44.601647 ], [ 7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [
7.310826, 44.60021 ], [ 7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [
7.31373, 44.600258 ], [ 7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [
7.321178, 44.60314 ], [ 7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [
7.32165, 44.603651 ], [ 7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [
7.326698, 44.602888 ], [ 7.328, 44.60225 ], [ 7.328368, 44.602076 ], [
7.32888, 44.601885 ], [ 7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [
7.342134, 44.598117 ], [ 7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [
7.351195, 44.592361 ], [ 7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [
7.354039, 44.589058 ], [ 7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [
7.359394, 44.585768 ], [ 7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [
7.38535, 44.578423 ], [ 7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [
7.382396, 44.577341 ], [ 7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [
7.380966, 44.569408 ], [ 7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [
7.381304, 44.567198 ], [ 7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [
7.380793, 44.565679 ], [ 7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [
7.380296, 44.564952 ], [ 7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [
7.37255, 44.55782 ], [ 7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [
7.371188, 44.556999 ], [ 7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [
7.366203, 44.548871 ], [ 7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [
7.365865, 44.53778 ], [ 7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [
7.365408, 44.536796 ], [ 7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [
7.36116, 44.541038 ], [ 7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [
7.360399, 44.545938 ], [ 7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [
7.342703, 44.554933 ], [ 7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [
7.347775, 44.558891 ], [ 7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [
7.351205, 44.560808 ], [ 7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [
7.351155, 44.562437 ], [ 7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [
7.329611, 44.574551 ], [ 7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [
7.313023, 44.579704 ], [ 7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [
7.308875, 44.580215 ], [ 7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [
7.306584, 44.579605 ], [ 7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [
7.303958, 44.580187 ], [ 7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [
7.294473, 44.582476 ], [ 7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [
7.279485, 44.591172 ], [ 7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [
7.276883, 44.591565 ], [ 7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [
7.266041, 44.591361 ], [ 7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [
7.263705, 44.591586 ], [ 7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [
7.259575, 44.592595 ], [ 7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [
7.259576, 44.593418 ], [ 7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [
7.268139, 44.600098 ], [ 7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [
7.274251, 44.612811 ], [ 7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [
7.282782, 44.61294 ] ] ] }, _id: ObjectId('5178dda27cad6ae806000001') }",
"code" : 13026,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem???
thanks a lot
Stefano
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Rob Moore
2013-04-26 17:12:10 UTC
Permalink
Oops. The index should be on geometry.

db.cities.ensureIndex({ "geometry" : "2dsphere"})

Sorry about that.

Rob.
Post by Stefano Passiatore
"err" : "Can't extract geo keys from object, malformed geometry?:{ 0: [ [
7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [ 7.286837, 44.611853 ], [
7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [ 7.295425, 44.606333 ], [
7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [ 7.302949, 44.601647 ], [
7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [ 7.310826, 44.60021 ], [
7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [ 7.31373, 44.600258 ], [
7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [ 7.321178, 44.60314 ], [
7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [ 7.32165, 44.603651 ], [
7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [ 7.326698, 44.602888 ], [
7.328, 44.60225 ], [ 7.328368, 44.602076 ], [ 7.32888, 44.601885 ], [
7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [ 7.342134, 44.598117 ], [
7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [ 7.351195, 44.592361 ], [
7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [ 7.354039, 44.589058 ], [
7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [ 7.359394, 44.585768 ], [
7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [ 7.38535, 44.578423 ], [
7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [ 7.382396, 44.577341 ], [
7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [ 7.380966, 44.569408 ], [
7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [ 7.381304, 44.567198 ], [
7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [ 7.380793, 44.565679 ], [
7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [ 7.380296, 44.564952 ], [
7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [ 7.37255, 44.55782 ], [
7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [ 7.371188, 44.556999 ], [
7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [ 7.366203, 44.548871 ], [
7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [ 7.365865, 44.53778 ], [
7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [ 7.365408, 44.536796 ], [
7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [ 7.36116, 44.541038 ], [
7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [ 7.360399, 44.545938 ], [
7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [ 7.342703, 44.554933 ], [
7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [ 7.347775, 44.558891 ], [
7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [ 7.351205, 44.560808 ], [
7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [ 7.351155, 44.562437 ], [
7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [ 7.329611, 44.574551 ], [
7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [ 7.313023, 44.579704 ], [
7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [ 7.308875, 44.580215 ], [
7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [ 7.306584, 44.579605 ], [
7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [ 7.303958, 44.580187 ], [
7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [ 7.294473, 44.582476 ], [
7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [ 7.279485, 44.591172 ], [
7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [ 7.276883, 44.591565 ], [
7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [ 7.266041, 44.591361 ], [
7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [ 7.263705, 44.591586 ], [
7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [ 7.259575, 44.592595 ], [
7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [ 7.259576, 44.593418 ], [
7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [ 7.268139, 44.600098 ], [
7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [ 7.274251, 44.612811 ], [
7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [ 7.282782, 44.61294 ] ] }",
"code" : 16572,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem!?!?
Thanks a lot!
Stefano
Post by Rob Moore
http://docs.mongodb.org/manual/core/2d/.
http://docs.mongodb.org/manual/core/2dsphere/
db.cities.ensureIndex({ "geometry.coordinates" : "2dsphere"})
Rob.
Post by Stefano Passiatore
{"geometry" : { "type" : "Polygon", "coordinates" :[[[7.282782,
44.61294], [7.283935, 44.61293], [7.286837, 44.611853], [7.287715,
44.611461], [7.288526, 44.610983], [7.295425, 44.606333], [7.300007,
44.603012], [7.300558, 44.602718], [7.302949, 44.601647], [7.304067,
44.601344], [7.3086, 44.600466], [7.310826, 44.60021], [7.311634,
44.600195], [7.312773, 44.600203], [7.31373, 44.600258], [7.314291,
44.600316], [7.315784, 44.60086], [7.321178, 44.60314], [7.321289,
44.603223], [7.32139, 44.603319], [7.32165, 44.603651], [7.322174,
44.604339], [7.326342, 44.603108], [7.326698, 44.602888], [7.328,
44.60225], [7.328368, 44.602076], [7.32888, 44.601885], [7.339799,
44.598299], [7.341376, 44.598174], [7.342134, 44.598117], [7.342739,
44.598126], [7.348733, 44.598306], [7.351195, 44.592361], [7.351943,
44.591413], [7.353902, 44.589155], [7.354039, 44.589058], [7.355697,
44.587907], [7.357086, 44.586982], [7.359394, 44.585768], [7.376656,
44.580595], [7.383961, 44.578615], [7.38535, 44.578423], [7.383638,
44.577953], [7.383327, 44.577841], [7.382396, 44.577341], [7.381946,
44.575868], [7.381501, 44.573746], [7.380966, 44.569408], [7.381147,
44.568781], [7.38128, 44.567612], [7.381304, 44.567198], [7.38127,
44.567081], [7.3809, 44.565878], [7.380793, 44.565679], [7.380759,
44.565629], [7.380648, 44.565461], [7.380296, 44.564952], [7.374248,
44.55788], [7.372901, 44.557861], [7.37255, 44.55782], [7.372336,
44.55779], [7.372077, 44.557624], [7.371188, 44.556999], [7.371028,
44.556844], [7.366489, 44.549433], [7.366203, 44.548871], [7.366075,
44.548491], [7.366018, 44.548256], [7.365865, 44.53778], [7.366244,
44.536601], [7.36549, 44.536775], [7.365408, 44.536796], [7.361493,
44.540386], [7.361232, 44.540706], [7.36116, 44.541038], [7.361304,
44.541743], [7.361403, 44.542257], [7.360399, 44.545938], [7.354438,
44.549539], [7.345313, 44.553926], [7.342703, 44.554933], [7.343596,
44.557867], [7.34742, 44.558791], [7.347775, 44.558891], [7.348122,
44.559031], [7.350721, 44.560482], [7.351205, 44.560808], [7.351473,
44.561492], [7.35163, 44.561985], [7.351155, 44.562437], [7.350743,
44.56271], [7.343885, 44.566819], [7.329611, 44.574551], [7.32569,
44.57624], [7.32096, 44.57771], [7.313023, 44.579704], [7.310811,
44.580113], [7.310414, 44.58017], [7.308875, 44.580215], [7.307107,
44.579635], [7.306834, 44.579617], [7.306584, 44.579605], [7.30631,
44.579623], [7.305864, 44.579724], [7.303958, 44.580187], [7.301737,
44.580892], [7.30132, 44.581286], [7.294473, 44.582476], [7.285745,
44.587211], [7.279721, 44.591032], [7.279485, 44.591172], [7.279152,
44.591343], [7.278986, 44.591408], [7.276883, 44.591565], [7.271547,
44.591728], [7.268992, 44.59168], [7.266041, 44.591361], [7.265591,
44.591358], [7.265026, 44.591422], [7.263705, 44.591586], [7.260174,
44.592383], [7.25983, 44.592504], [7.259575, 44.592595], [7.259229,
44.592774], [7.259351, 44.593046], [7.259576, 44.593418], [7.267426,
44.599461], [7.267864, 44.599805], [7.268139, 44.600098], [7.273074,
44.610057], [7.273391, 44.610782], [7.274251, 44.612811], [7.274412,
44.613394], [7.274326, 44.615935], [7.282782, 44.61294]]]}
db.cities.ensureIndex({ "geometry.coordinates" : "2d"})
\"Brossasco\", COD_REG: 1, COD_PRO: 4, geometry: { type: \"Polygon\",
coordinates: [ [ [ 7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [
7.286837, 44.611853 ], [ 7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [
7.295425, 44.606333 ], [ 7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [
7.302949, 44.601647 ], [ 7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [
7.310826, 44.60021 ], [ 7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [
7.31373, 44.600258 ], [ 7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [
7.321178, 44.60314 ], [ 7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [
7.32165, 44.603651 ], [ 7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [
7.326698, 44.602888 ], [ 7.328, 44.60225 ], [ 7.328368, 44.602076 ], [
7.32888, 44.601885 ], [ 7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [
7.342134, 44.598117 ], [ 7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [
7.351195, 44.592361 ], [ 7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [
7.354039, 44.589058 ], [ 7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [
7.359394, 44.585768 ], [ 7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [
7.38535, 44.578423 ], [ 7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [
7.382396, 44.577341 ], [ 7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [
7.380966, 44.569408 ], [ 7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [
7.381304, 44.567198 ], [ 7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [
7.380793, 44.565679 ], [ 7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [
7.380296, 44.564952 ], [ 7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [
7.37255, 44.55782 ], [ 7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [
7.371188, 44.556999 ], [ 7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [
7.366203, 44.548871 ], [ 7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [
7.365865, 44.53778 ], [ 7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [
7.365408, 44.536796 ], [ 7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [
7.36116, 44.541038 ], [ 7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [
7.360399, 44.545938 ], [ 7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [
7.342703, 44.554933 ], [ 7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [
7.347775, 44.558891 ], [ 7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [
7.351205, 44.560808 ], [ 7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [
7.351155, 44.562437 ], [ 7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [
7.329611, 44.574551 ], [ 7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [
7.313023, 44.579704 ], [ 7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [
7.308875, 44.580215 ], [ 7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [
7.306584, 44.579605 ], [ 7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [
7.303958, 44.580187 ], [ 7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [
7.294473, 44.582476 ], [ 7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [
7.279485, 44.591172 ], [ 7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [
7.276883, 44.591565 ], [ 7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [
7.266041, 44.591361 ], [ 7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [
7.263705, 44.591586 ], [ 7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [
7.259575, 44.592595 ], [ 7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [
7.259576, 44.593418 ], [ 7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [
7.268139, 44.600098 ], [ 7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [
7.274251, 44.612811 ], [ 7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [
7.282782, 44.61294 ] ] ] }, _id: ObjectId('5178dda27cad6ae806000001') }",
"code" : 13026,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem???
thanks a lot
Stefano
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Stefano Passiatore
2013-04-26 18:12:24 UTC
Permalink
Hi Rob, sorry but I got the same error:

{
"err" : "Can't extract geo keys from object, malformed geometry?:{ type:
\"MultiPolygon\", coordinates: [ [ [ [ 7.578947, 44.812755 ], [ 7.576356,
44.810477 ], [ 7.576287, 44.810395 ], [ 7.576042, 44.810032 ], [ 7.575818,
44.80966 ], [ 7.57552, 44.809103 ], [ 7.575416, 44.808516 ], [ 7.575437,
44.808188 ], [ 7.575654, 44.807772 ], [ 7.575952, 44.807348 ], [ 7.576294,
44.807091 ], [ 7.576564, 44.806973 ], [ 7.576843, 44.806914 ], [ 7.577611,
44.806802 ], [ 7.57874, 44.806703 ], [ 7.579419, 44.806892 ], [ 7.579581,
44.807065 ], [ 7.579754, 44.807702 ], [ 7.57983, 44.808045 ], [ 7.579988,
44.808803 ], [ 7.579984, 44.809104 ], [ 7.579971, 44.809635 ], [ 7.579917,
44.809887 ], [ 7.579866, 44.810052 ], [ 7.584669, 44.810733 ], [ 7.591897,
44.810364 ], [ 7.592014, 44.810279 ], [ 7.592604, 44.809261 ], [ 7.592242,
44.806132 ], [ 7.592126, 44.805285 ], [ 7.590433, 44.80371 ], [ 7.586231,
44.8 ], [ 7.585696, 44.799561 ], [ 7.584459, 44.798781 ], [ 7.583946,
44.79868 ], [ 7.583374, 44.798646 ], [ 7.582871, 44.798711 ], [ 7.577682,
44.791391 ], [ 7.570782, 44.776929 ], [ 7.571381, 44.772341 ], [ 7.570277,
44.77248 ], [ 7.561635, 44.773812 ], [ 7.560438, 44.775165 ], [ 7.558907,
44.778846 ], [ 7.558678, 44.780886 ], [ 7.559128, 44.783124 ], [ 7.559581,
44.78345 ], [ 7.560704, 44.784252 ], [ 7.559225, 44.791097 ], [ 7.559099,
44.791455 ], [ 7.558206, 44.793569 ], [ 7.557476, 44.795198 ], [ 7.555227,
44.796213 ], [ 7.557071, 44.796804 ], [ 7.563534, 44.798996 ], [ 7.565817,
44.799966 ], [ 7.568377, 44.803918 ], [ 7.568342, 44.804588 ], [ 7.567565,
44.807819 ], [ 7.567195, 44.808089 ], [ 7.566726, 44.808299 ], [ 7.565905,
44.808523 ], [ 7.565074, 44.808724 ], [ 7.564204, 44.809037 ], [ 7.562682,
44.809621 ], [ 7.562177, 44.809872 ], [ 7.561286, 44.810698 ], [ 7.560974,
44.811175 ], [ 7.560819, 44.81156 ], [ 7.560805, 44.811731 ], [ 7.562101,
44.812936 ], [ 7.56276, 44.813457 ], [ 7.563442, 44.813704 ], [ 7.564018,
44.813568 ], [ 7.564678, 44.813333 ], [ 7.565867, 44.812839 ], [ 7.566826,
44.812365 ], [ 7.568379, 44.812965 ], [ 7.569425, 44.81337 ], [ 7.570565,
44.813888 ], [ 7.571013, 44.814164 ], [ 7.571612, 44.814847 ], [ 7.571929,
44.815593 ], [ 7.572159, 44.816195 ], [ 7.572449, 44.816599 ], [ 7.573443,
44.817881 ], [ 7.57398, 44.818468 ], [ 7.574632, 44.819021 ], [ 7.575727,
44.81993 ], [ 7.576134, 44.820246 ], [ 7.576601, 44.820594 ], [ 7.577323,
44.819567 ], [ 7.580095, 44.81533 ], [ 7.580113, 44.815281 ], [ 7.580076,
44.81515 ], [ 7.57992, 44.814608 ], [ 7.579761, 44.814179 ], [ 7.579429,
44.813517 ], [ 7.579243, 44.813222 ], [ 7.578947, 44.812755 ] ] ], [ [ [
7.598665, 44.81127 ], [ 7.597797, 44.810859 ], [ 7.596849, 44.811419 ], [
7.596124, 44.812031 ], [ 7.596067, 44.812134 ], [ 7.595242, 44.822422 ], [
7.59785, 44.824183 ], [ 7.598792, 44.818433 ], [ 7.598665, 44.81127 ] ] ] ]
}",
"code" : 16572,
"n" : 0,
"connectionId" : 1,
"ok" : 1
}

thanks!
Stefano
Post by Rob Moore
Oops. The index should be on geometry.
db.cities.ensureIndex({ "geometry" : "2dsphere"})
Sorry about that.
Rob.
Post by Stefano Passiatore
"err" : "Can't extract geo keys from object, malformed geometry?:{ 0: [ [
7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [ 7.286837, 44.611853 ], [
7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [ 7.295425, 44.606333 ], [
7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [ 7.302949, 44.601647 ], [
7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [ 7.310826, 44.60021 ], [
7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [ 7.31373, 44.600258 ], [
7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [ 7.321178, 44.60314 ], [
7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [ 7.32165, 44.603651 ], [
7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [ 7.326698, 44.602888 ], [
7.328, 44.60225 ], [ 7.328368, 44.602076 ], [ 7.32888, 44.601885 ], [
7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [ 7.342134, 44.598117 ], [
7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [ 7.351195, 44.592361 ], [
7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [ 7.354039, 44.589058 ], [
7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [ 7.359394, 44.585768 ], [
7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [ 7.38535, 44.578423 ], [
7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [ 7.382396, 44.577341 ], [
7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [ 7.380966, 44.569408 ], [
7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [ 7.381304, 44.567198 ], [
7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [ 7.380793, 44.565679 ], [
7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [ 7.380296, 44.564952 ], [
7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [ 7.37255, 44.55782 ], [
7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [ 7.371188, 44.556999 ], [
7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [ 7.366203, 44.548871 ], [
7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [ 7.365865, 44.53778 ], [
7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [ 7.365408, 44.536796 ], [
7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [ 7.36116, 44.541038 ], [
7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [ 7.360399, 44.545938 ], [
7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [ 7.342703, 44.554933 ], [
7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [ 7.347775, 44.558891 ], [
7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [ 7.351205, 44.560808 ], [
7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [ 7.351155, 44.562437 ], [
7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [ 7.329611, 44.574551 ], [
7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [ 7.313023, 44.579704 ], [
7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [ 7.308875, 44.580215 ], [
7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [ 7.306584, 44.579605 ], [
7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [ 7.303958, 44.580187 ], [
7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [ 7.294473, 44.582476 ], [
7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [ 7.279485, 44.591172 ], [
7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [ 7.276883, 44.591565 ], [
7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [ 7.266041, 44.591361 ], [
7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [ 7.263705, 44.591586 ], [
7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [ 7.259575, 44.592595 ], [
7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [ 7.259576, 44.593418 ], [
7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [ 7.268139, 44.600098 ], [
7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [ 7.274251, 44.612811 ], [
7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [ 7.282782, 44.61294 ] ] }",
"code" : 16572,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem!?!?
Thanks a lot!
Stefano
Post by Rob Moore
http://docs.mongodb.org/manual/core/2d/.
http://docs.mongodb.org/manual/core/2dsphere/
db.cities.ensureIndex({ "geometry.coordinates" : "2dsphere"})
Rob.
Post by Stefano Passiatore
{"geometry" : { "type" : "Polygon", "coordinates" :[[[7.282782,
44.61294], [7.283935, 44.61293], [7.286837, 44.611853], [7.287715,
44.611461], [7.288526, 44.610983], [7.295425, 44.606333], [7.300007,
44.603012], [7.300558, 44.602718], [7.302949, 44.601647], [7.304067,
44.601344], [7.3086, 44.600466], [7.310826, 44.60021], [7.311634,
44.600195], [7.312773, 44.600203], [7.31373, 44.600258], [7.314291,
44.600316], [7.315784, 44.60086], [7.321178, 44.60314], [7.321289,
44.603223], [7.32139, 44.603319], [7.32165, 44.603651], [7.322174,
44.604339], [7.326342, 44.603108], [7.326698, 44.602888], [7.328,
44.60225], [7.328368, 44.602076], [7.32888, 44.601885], [7.339799,
44.598299], [7.341376, 44.598174], [7.342134, 44.598117], [7.342739,
44.598126], [7.348733, 44.598306], [7.351195, 44.592361], [7.351943,
44.591413], [7.353902, 44.589155], [7.354039, 44.589058], [7.355697,
44.587907], [7.357086, 44.586982], [7.359394, 44.585768], [7.376656,
44.580595], [7.383961, 44.578615], [7.38535, 44.578423], [7.383638,
44.577953], [7.383327, 44.577841], [7.382396, 44.577341], [7.381946,
44.575868], [7.381501, 44.573746], [7.380966, 44.569408], [7.381147,
44.568781], [7.38128, 44.567612], [7.381304, 44.567198], [7.38127,
44.567081], [7.3809, 44.565878], [7.380793, 44.565679], [7.380759,
44.565629], [7.380648, 44.565461], [7.380296, 44.564952], [7.374248,
44.55788], [7.372901, 44.557861], [7.37255, 44.55782], [7.372336,
44.55779], [7.372077, 44.557624], [7.371188, 44.556999], [7.371028,
44.556844], [7.366489, 44.549433], [7.366203, 44.548871], [7.366075,
44.548491], [7.366018, 44.548256], [7.365865, 44.53778], [7.366244,
44.536601], [7.36549, 44.536775], [7.365408, 44.536796], [7.361493,
44.540386], [7.361232, 44.540706], [7.36116, 44.541038], [7.361304,
44.541743], [7.361403, 44.542257], [7.360399, 44.545938], [7.354438,
44.549539], [7.345313, 44.553926], [7.342703, 44.554933], [7.343596,
44.557867], [7.34742, 44.558791], [7.347775, 44.558891], [7.348122,
44.559031], [7.350721, 44.560482], [7.351205, 44.560808], [7.351473,
44.561492], [7.35163, 44.561985], [7.351155, 44.562437], [7.350743,
44.56271], [7.343885, 44.566819], [7.329611, 44.574551], [7.32569,
44.57624], [7.32096, 44.57771], [7.313023, 44.579704], [7.310811,
44.580113], [7.310414, 44.58017], [7.308875, 44.580215], [7.307107,
44.579635], [7.306834, 44.579617], [7.306584, 44.579605], [7.30631,
44.579623], [7.305864, 44.579724], [7.303958, 44.580187], [7.301737,
44.580892], [7.30132, 44.581286], [7.294473, 44.582476], [7.285745,
44.587211], [7.279721, 44.591032], [7.279485, 44.591172], [7.279152,
44.591343], [7.278986, 44.591408], [7.276883, 44.591565], [7.271547,
44.591728], [7.268992, 44.59168], [7.266041, 44.591361], [7.265591,
44.591358], [7.265026, 44.591422], [7.263705, 44.591586], [7.260174,
44.592383], [7.25983, 44.592504], [7.259575, 44.592595], [7.259229,
44.592774], [7.259351, 44.593046], [7.259576, 44.593418], [7.267426,
44.599461], [7.267864, 44.599805], [7.268139, 44.600098], [7.273074,
44.610057], [7.273391, 44.610782], [7.274251, 44.612811], [7.274412,
44.613394], [7.274326, 44.615935], [7.282782, 44.61294]]]}
db.cities.ensureIndex({ "geometry.coordinates" : "2d"})
\"Brossasco\", COD_REG: 1, COD_PRO: 4, geometry: { type: \"Polygon\",
coordinates: [ [ [ 7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [
7.286837, 44.611853 ], [ 7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [
7.295425, 44.606333 ], [ 7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [
7.302949, 44.601647 ], [ 7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [
7.310826, 44.60021 ], [ 7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [
7.31373, 44.600258 ], [ 7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [
7.321178, 44.60314 ], [ 7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [
7.32165, 44.603651 ], [ 7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [
7.326698, 44.602888 ], [ 7.328, 44.60225 ], [ 7.328368, 44.602076 ], [
7.32888, 44.601885 ], [ 7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [
7.342134, 44.598117 ], [ 7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [
7.351195, 44.592361 ], [ 7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [
7.354039, 44.589058 ], [ 7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [
7.359394, 44.585768 ], [ 7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [
7.38535, 44.578423 ], [ 7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [
7.382396, 44.577341 ], [ 7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [
7.380966, 44.569408 ], [ 7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [
7.381304, 44.567198 ], [ 7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [
7.380793, 44.565679 ], [ 7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [
7.380296, 44.564952 ], [ 7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [
7.37255, 44.55782 ], [ 7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [
7.371188, 44.556999 ], [ 7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [
7.366203, 44.548871 ], [ 7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [
7.365865, 44.53778 ], [ 7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [
7.365408, 44.536796 ], [ 7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [
7.36116, 44.541038 ], [ 7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [
7.360399, 44.545938 ], [ 7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [
7.342703, 44.554933 ], [ 7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [
7.347775, 44.558891 ], [ 7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [
7.351205, 44.560808 ], [ 7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [
7.351155, 44.562437 ], [ 7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [
7.329611, 44.574551 ], [ 7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [
7.313023, 44.579704 ], [ 7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [
7.308875, 44.580215 ], [ 7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [
7.306584, 44.579605 ], [ 7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [
7.303958, 44.580187 ], [ 7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [
7.294473, 44.582476 ], [ 7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [
7.279485, 44.591172 ], [ 7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [
7.276883, 44.591565 ], [ 7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [
7.266041, 44.591361 ], [ 7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [
7.263705, 44.591586 ], [ 7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [
7.259575, 44.592595 ], [ 7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [
7.259576, 44.593418 ], [ 7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [
7.268139, 44.600098 ], [ 7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [
7.274251, 44.612811 ], [ 7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [
7.282782, 44.61294 ] ] ] }, _id: ObjectId('5178dda27cad6ae806000001') }",
"code" : 13026,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem???
thanks a lot
Stefano
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Bernie Hackett
2013-04-26 18:25:35 UTC
Permalink
"err" : "Can't extract geo keys from object, malformed geometry?:{ type: \"MultiPolygon\",
MongoDB doesn't support MultiPolygon, only Polygon. The supported
types are listed here:

http://docs.mongodb.org/manual/core/2dsphere/#store-geojson-objects

On Fri, Apr 26, 2013 at 11:12 AM, Stefano Passiatore
{
\"MultiPolygon\", coordinates: [ [ [ [ 7.578947, 44.812755 ], [ 7.576356,
44.810477 ], [ 7.576287, 44.810395 ], [ 7.576042, 44.810032 ], [ 7.575818,
44.80966 ], [ 7.57552, 44.809103 ], [ 7.575416, 44.808516 ], [ 7.575437,
44.808188 ], [ 7.575654, 44.807772 ], [ 7.575952, 44.807348 ], [ 7.576294,
44.807091 ], [ 7.576564, 44.806973 ], [ 7.576843, 44.806914 ], [ 7.577611,
44.806802 ], [ 7.57874, 44.806703 ], [ 7.579419, 44.806892 ], [ 7.579581,
44.807065 ], [ 7.579754, 44.807702 ], [ 7.57983, 44.808045 ], [ 7.579988,
44.808803 ], [ 7.579984, 44.809104 ], [ 7.579971, 44.809635 ], [ 7.579917,
44.809887 ], [ 7.579866, 44.810052 ], [ 7.584669, 44.810733 ], [ 7.591897,
44.810364 ], [ 7.592014, 44.810279 ], [ 7.592604, 44.809261 ], [ 7.592242,
44.806132 ], [ 7.592126, 44.805285 ], [ 7.590433, 44.80371 ], [ 7.586231,
44.8 ], [ 7.585696, 44.799561 ], [ 7.584459, 44.798781 ], [ 7.583946,
44.79868 ], [ 7.583374, 44.798646 ], [ 7.582871, 44.798711 ], [ 7.577682,
44.791391 ], [ 7.570782, 44.776929 ], [ 7.571381, 44.772341 ], [ 7.570277,
44.77248 ], [ 7.561635, 44.773812 ], [ 7.560438, 44.775165 ], [ 7.558907,
44.778846 ], [ 7.558678, 44.780886 ], [ 7.559128, 44.783124 ], [ 7.559581,
44.78345 ], [ 7.560704, 44.784252 ], [ 7.559225, 44.791097 ], [ 7.559099,
44.791455 ], [ 7.558206, 44.793569 ], [ 7.557476, 44.795198 ], [ 7.555227,
44.796213 ], [ 7.557071, 44.796804 ], [ 7.563534, 44.798996 ], [ 7.565817,
44.799966 ], [ 7.568377, 44.803918 ], [ 7.568342, 44.804588 ], [ 7.567565,
44.807819 ], [ 7.567195, 44.808089 ], [ 7.566726, 44.808299 ], [ 7.565905,
44.808523 ], [ 7.565074, 44.808724 ], [ 7.564204, 44.809037 ], [ 7.562682,
44.809621 ], [ 7.562177, 44.809872 ], [ 7.561286, 44.810698 ], [ 7.560974,
44.811175 ], [ 7.560819, 44.81156 ], [ 7.560805, 44.811731 ], [ 7.562101,
44.812936 ], [ 7.56276, 44.813457 ], [ 7.563442, 44.813704 ], [ 7.564018,
44.813568 ], [ 7.564678, 44.813333 ], [ 7.565867, 44.812839 ], [ 7.566826,
44.812365 ], [ 7.568379, 44.812965 ], [ 7.569425, 44.81337 ], [ 7.570565,
44.813888 ], [ 7.571013, 44.814164 ], [ 7.571612, 44.814847 ], [ 7.571929,
44.815593 ], [ 7.572159, 44.816195 ], [ 7.572449, 44.816599 ], [ 7.573443,
44.817881 ], [ 7.57398, 44.818468 ], [ 7.574632, 44.819021 ], [ 7.575727,
44.81993 ], [ 7.576134, 44.820246 ], [ 7.576601, 44.820594 ], [ 7.577323,
44.819567 ], [ 7.580095, 44.81533 ], [ 7.580113, 44.815281 ], [ 7.580076,
44.81515 ], [ 7.57992, 44.814608 ], [ 7.579761, 44.814179 ], [ 7.579429,
44.813517 ], [ 7.579243, 44.813222 ], [ 7.578947, 44.812755 ] ] ], [ [ [
7.598665, 44.81127 ], [ 7.597797, 44.810859 ], [ 7.596849, 44.811419 ], [
7.596124, 44.812031 ], [ 7.596067, 44.812134 ], [ 7.595242, 44.822422 ], [
7.59785, 44.824183 ], [ 7.598792, 44.818433 ], [ 7.598665, 44.81127 ] ] ] ]
}",
"code" : 16572,
"n" : 0,
"connectionId" : 1,
"ok" : 1
}
thanks!
Stefano
Post by Rob Moore
Oops. The index should be on geometry.
db.cities.ensureIndex({ "geometry" : "2dsphere"})
Sorry about that.
Rob.
Post by Stefano Passiatore
"err" : "Can't extract geo keys from object, malformed geometry?:{ 0: [ [
7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [ 7.286837, 44.611853 ], [
7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [ 7.295425, 44.606333 ], [
7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [ 7.302949, 44.601647 ], [
7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [ 7.310826, 44.60021 ], [
7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [ 7.31373, 44.600258 ], [
7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [ 7.321178, 44.60314 ], [
7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [ 7.32165, 44.603651 ], [
7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [ 7.326698, 44.602888 ], [
7.328, 44.60225 ], [ 7.328368, 44.602076 ], [ 7.32888, 44.601885 ], [
7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [ 7.342134, 44.598117 ], [
7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [ 7.351195, 44.592361 ], [
7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [ 7.354039, 44.589058 ], [
7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [ 7.359394, 44.585768 ], [
7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [ 7.38535, 44.578423 ], [
7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [ 7.382396, 44.577341 ], [
7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [ 7.380966, 44.569408 ], [
7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [ 7.381304, 44.567198 ], [
7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [ 7.380793, 44.565679 ], [
7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [ 7.380296, 44.564952 ], [
7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [ 7.37255, 44.55782 ], [
7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [ 7.371188, 44.556999 ], [
7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [ 7.366203, 44.548871 ], [
7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [ 7.365865, 44.53778 ], [
7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [ 7.365408, 44.536796 ], [
7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [ 7.36116, 44.541038 ], [
7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [ 7.360399, 44.545938 ], [
7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [ 7.342703, 44.554933 ], [
7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [ 7.347775, 44.558891 ], [
7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [ 7.351205, 44.560808 ], [
7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [ 7.351155, 44.562437 ], [
7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [ 7.329611, 44.574551 ], [
7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [ 7.313023, 44.579704 ], [
7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [ 7.308875, 44.580215 ], [
7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [ 7.306584, 44.579605 ], [
7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [ 7.303958, 44.580187 ], [
7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [ 7.294473, 44.582476 ], [
7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [ 7.279485, 44.591172 ], [
7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [ 7.276883, 44.591565 ], [
7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [ 7.266041, 44.591361 ], [
7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [ 7.263705, 44.591586 ], [
7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [ 7.259575, 44.592595 ], [
7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [ 7.259576, 44.593418 ], [
7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [ 7.268139, 44.600098 ], [
7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [ 7.274251, 44.612811 ], [
7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [ 7.282782, 44.61294 ] ] }",
"code" : 16572,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem!?!?
Thanks a lot!
Stefano
Post by Rob Moore
http://docs.mongodb.org/manual/core/2d/.
http://docs.mongodb.org/manual/core/2dsphere/
db.cities.ensureIndex({ "geometry.coordinates" : "2dsphere"})
Rob.
Post by Stefano Passiatore
{"geometry" : { "type" : "Polygon", "coordinates" :[[[7.282782,
44.61294], [7.283935, 44.61293], [7.286837, 44.611853], [7.287715,
44.611461], [7.288526, 44.610983], [7.295425, 44.606333], [7.300007,
44.603012], [7.300558, 44.602718], [7.302949, 44.601647], [7.304067,
44.601344], [7.3086, 44.600466], [7.310826, 44.60021], [7.311634,
44.600195], [7.312773, 44.600203], [7.31373, 44.600258], [7.314291,
44.600316], [7.315784, 44.60086], [7.321178, 44.60314], [7.321289,
44.603223], [7.32139, 44.603319], [7.32165, 44.603651], [7.322174,
44.604339], [7.326342, 44.603108], [7.326698, 44.602888], [7.328, 44.60225],
[7.328368, 44.602076], [7.32888, 44.601885], [7.339799, 44.598299],
[7.341376, 44.598174], [7.342134, 44.598117], [7.342739, 44.598126],
[7.348733, 44.598306], [7.351195, 44.592361], [7.351943, 44.591413],
[7.353902, 44.589155], [7.354039, 44.589058], [7.355697, 44.587907],
[7.357086, 44.586982], [7.359394, 44.585768], [7.376656, 44.580595],
[7.383961, 44.578615], [7.38535, 44.578423], [7.383638, 44.577953],
[7.383327, 44.577841], [7.382396, 44.577341], [7.381946, 44.575868],
[7.381501, 44.573746], [7.380966, 44.569408], [7.381147, 44.568781],
[7.38128, 44.567612], [7.381304, 44.567198], [7.38127, 44.567081], [7.3809,
44.565878], [7.380793, 44.565679], [7.380759, 44.565629], [7.380648,
44.565461], [7.380296, 44.564952], [7.374248, 44.55788], [7.372901,
44.557861], [7.37255, 44.55782], [7.372336, 44.55779], [7.372077,
44.557624], [7.371188, 44.556999], [7.371028, 44.556844], [7.366489,
44.549433], [7.366203, 44.548871], [7.366075, 44.548491], [7.366018,
44.548256], [7.365865, 44.53778], [7.366244, 44.536601], [7.36549,
44.536775], [7.365408, 44.536796], [7.361493, 44.540386], [7.361232,
44.540706], [7.36116, 44.541038], [7.361304, 44.541743], [7.361403,
44.542257], [7.360399, 44.545938], [7.354438, 44.549539], [7.345313,
44.553926], [7.342703, 44.554933], [7.343596, 44.557867], [7.34742,
44.558791], [7.347775, 44.558891], [7.348122, 44.559031], [7.350721,
44.560482], [7.351205, 44.560808], [7.351473, 44.561492], [7.35163,
44.561985], [7.351155, 44.562437], [7.350743, 44.56271], [7.343885,
44.566819], [7.329611, 44.574551], [7.32569, 44.57624], [7.32096, 44.57771],
[7.313023, 44.579704], [7.310811, 44.580113], [7.310414, 44.58017],
[7.308875, 44.580215], [7.307107, 44.579635], [7.306834, 44.579617],
[7.306584, 44.579605], [7.30631, 44.579623], [7.305864, 44.579724],
[7.303958, 44.580187], [7.301737, 44.580892], [7.30132, 44.581286],
[7.294473, 44.582476], [7.285745, 44.587211], [7.279721, 44.591032],
[7.279485, 44.591172], [7.279152, 44.591343], [7.278986, 44.591408],
[7.276883, 44.591565], [7.271547, 44.591728], [7.268992, 44.59168],
[7.266041, 44.591361], [7.265591, 44.591358], [7.265026, 44.591422],
[7.263705, 44.591586], [7.260174, 44.592383], [7.25983, 44.592504],
[7.259575, 44.592595], [7.259229, 44.592774], [7.259351, 44.593046],
[7.259576, 44.593418], [7.267426, 44.599461], [7.267864, 44.599805],
[7.268139, 44.600098], [7.273074, 44.610057], [7.273391, 44.610782],
[7.274251, 44.612811], [7.274412, 44.613394], [7.274326, 44.615935],
[7.282782, 44.61294]]]}
db.cities.ensureIndex({ "geometry.coordinates" : "2d"})
\"Brossasco\", COD_REG: 1, COD_PRO: 4, geometry: { type: \"Polygon\",
coordinates: [ [ [ 7.282782, 44.61294 ], [ 7.283935, 44.61293 ], [ 7.286837,
44.611853 ], [ 7.287715, 44.611461 ], [ 7.288526, 44.610983 ], [ 7.295425,
44.606333 ], [ 7.300007, 44.603012 ], [ 7.300558, 44.602718 ], [ 7.302949,
44.601647 ], [ 7.304067, 44.601344 ], [ 7.3086, 44.600466 ], [ 7.310826,
44.60021 ], [ 7.311634, 44.600195 ], [ 7.312773, 44.600203 ], [ 7.31373,
44.600258 ], [ 7.314291, 44.600316 ], [ 7.315784, 44.60086 ], [ 7.321178,
44.60314 ], [ 7.321289, 44.603223 ], [ 7.32139, 44.603319 ], [ 7.32165,
44.603651 ], [ 7.322174, 44.604339 ], [ 7.326342, 44.603108 ], [ 7.326698,
44.602888 ], [ 7.328, 44.60225 ], [ 7.328368, 44.602076 ], [ 7.32888,
44.601885 ], [ 7.339799, 44.598299 ], [ 7.341376, 44.598174 ], [ 7.342134,
44.598117 ], [ 7.342739, 44.598126 ], [ 7.348733, 44.598306 ], [ 7.351195,
44.592361 ], [ 7.351943, 44.591413 ], [ 7.353902, 44.589155 ], [ 7.354039,
44.589058 ], [ 7.355697, 44.587907 ], [ 7.357086, 44.586982 ], [ 7.359394,
44.585768 ], [ 7.376656, 44.580595 ], [ 7.383961, 44.578615 ], [ 7.38535,
44.578423 ], [ 7.383638, 44.577953 ], [ 7.383327, 44.577841 ], [ 7.382396,
44.577341 ], [ 7.381946, 44.575868 ], [ 7.381501, 44.573746 ], [ 7.380966,
44.569408 ], [ 7.381147, 44.568781 ], [ 7.38128, 44.567612 ], [ 7.381304,
44.567198 ], [ 7.38127, 44.567081 ], [ 7.3809, 44.565878 ], [ 7.380793,
44.565679 ], [ 7.380759, 44.565629 ], [ 7.380648, 44.565461 ], [ 7.380296,
44.564952 ], [ 7.374248, 44.55788 ], [ 7.372901, 44.557861 ], [ 7.37255,
44.55782 ], [ 7.372336, 44.55779 ], [ 7.372077, 44.557624 ], [ 7.371188,
44.556999 ], [ 7.371028, 44.556844 ], [ 7.366489, 44.549433 ], [ 7.366203,
44.548871 ], [ 7.366075, 44.548491 ], [ 7.366018, 44.548256 ], [ 7.365865,
44.53778 ], [ 7.366244, 44.536601 ], [ 7.36549, 44.536775 ], [ 7.365408,
44.536796 ], [ 7.361493, 44.540386 ], [ 7.361232, 44.540706 ], [ 7.36116,
44.541038 ], [ 7.361304, 44.541743 ], [ 7.361403, 44.542257 ], [ 7.360399,
44.545938 ], [ 7.354438, 44.549539 ], [ 7.345313, 44.553926 ], [ 7.342703,
44.554933 ], [ 7.343596, 44.557867 ], [ 7.34742, 44.558791 ], [ 7.347775,
44.558891 ], [ 7.348122, 44.559031 ], [ 7.350721, 44.560482 ], [ 7.351205,
44.560808 ], [ 7.351473, 44.561492 ], [ 7.35163, 44.561985 ], [ 7.351155,
44.562437 ], [ 7.350743, 44.56271 ], [ 7.343885, 44.566819 ], [ 7.329611,
44.574551 ], [ 7.32569, 44.57624 ], [ 7.32096, 44.57771 ], [ 7.313023,
44.579704 ], [ 7.310811, 44.580113 ], [ 7.310414, 44.58017 ], [ 7.308875,
44.580215 ], [ 7.307107, 44.579635 ], [ 7.306834, 44.579617 ], [ 7.306584,
44.579605 ], [ 7.30631, 44.579623 ], [ 7.305864, 44.579724 ], [ 7.303958,
44.580187 ], [ 7.301737, 44.580892 ], [ 7.30132, 44.581286 ], [ 7.294473,
44.582476 ], [ 7.285745, 44.587211 ], [ 7.279721, 44.591032 ], [ 7.279485,
44.591172 ], [ 7.279152, 44.591343 ], [ 7.278986, 44.591408 ], [ 7.276883,
44.591565 ], [ 7.271547, 44.591728 ], [ 7.268992, 44.59168 ], [ 7.266041,
44.591361 ], [ 7.265591, 44.591358 ], [ 7.265026, 44.591422 ], [ 7.263705,
44.591586 ], [ 7.260174, 44.592383 ], [ 7.25983, 44.592504 ], [ 7.259575,
44.592595 ], [ 7.259229, 44.592774 ], [ 7.259351, 44.593046 ], [ 7.259576,
44.593418 ], [ 7.267426, 44.599461 ], [ 7.267864, 44.599805 ], [ 7.268139,
44.600098 ], [ 7.273074, 44.610057 ], [ 7.273391, 44.610782 ], [ 7.274251,
44.612811 ], [ 7.274412, 44.613394 ], [ 7.274326, 44.615935 ], [ 7.282782,
44.61294 ] ] ] }, _id: ObjectId('5178dda27cad6ae806000001') }",
"code" : 13026,
"n" : 0,
"connectionId" : 1,
"ok" : 1
Where is the problem???
thanks a lot
Stefano
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To unsubscribe from this group, send email to
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/***@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/***@public.gmane.org
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...