我使用leafg.js和postgis(postgres)。 我想将多面体转换为几何体以存储在数据库中。 但是我收到了这个错误:
An error occurred when executing the SQL command:
SELECT ST_IsValid(ST_GeomFromGeoJSON(
'{"type":"MultiPolygon","coordinates":[[[["-57.70798","-34.93046"],["-57.75726","-34.97406"],["-57.79704","-3...
ERROR: Too few ordinates in GeoJSON
Execution time: 0.06s
Statement 1 of 1 finished
这是sql:
SELECT ST_IsValid(ST_GeomFromGeoJSON(
'{"type":"MultiPolygon","coordinates":[[[["-57.70798","-34.93046"],["-57.75726","-34.97406"],["-57.79704","-35.0092"],["-57.82553","-35.03433"],["-57.82947","-35.03326"],["-57.88522","-35.08194"],["-57.89918","-35.09413"],["-57.97495","-35.16014"],["-58.05345","-35.22834"],["-58.07267","-35.21478"],["-58.01711","-35.16484"],["-58.09865","-35.10165"],["-58.10727","-35.1088"],["-58.10771","-35.10844"],["-58.13532","-35.08701"],["-58.13331","-35.08354"],["-58.13614","-35.08133"],["-58.17227","-35.05289"],["-58.13257","-35.01659"],["-58.12937","-35.01367"],["-58.11987","-35.0047"],["-58.12426","-35.00139"],["-58.14057","-34.98855"],["-58.15054","-34.98053"],["-58.16223","-34.97212"],["-58.2524","-35.05101"],["-58.28768","-35.02247"],["-58.27846","-35.0145"],["-58.28089","-35.0064"],["-58.28502","-34.99721"],["-58.29281","-34.98461"],["-58.29844","-34.9762"],["-58.30129","-34.97204"],["-58.28781","-34.96512"],["-58.29033","-34.96173"],["-58.29698","-34.95302"],["-58.31683","-34.92619"],["-58.35886","-34.94651"],["-58.37551","-34.95506"],["-58.39981","-34.96879"],["-58.40084","-34.96736"],["-58.40507","-34.96969"],["-58.40172","-34.97378"],["-58.40545","-34.9759"],["-58.4039","-34.97795"],["-58.40863","-34.98008"],["-58.41222","-34.97661"],["-58.42043","-34.98044"],["-58.42172","-34.9786"],["-58.44035","-34.99"],["-58.46925","-35.01195"],["-58.46963","-35.01031"],["-58.46959","-35.00275"],["-58.46946","-34.99957"],["-58.46944","-34.99594"],["-58.46759","-34.98639"],["-58.46726","-34.98442"],["-58.46721","-34.98237"],["-58.46764","-34.97913"],["-58.46726","-34.97466"],["-58.46764","-34.96859"],["-58.46614","-34.9638"],["-58.46334","-34.95608"],["-58.46284","-34.95301"],["-58.46319","-34.95136"],["-58.46556","-34.94779"],["-58.4737","-34.94174"],["-58.49085","-34.92877"],["-58.49391","-34.93107"],["-58.49765","-34.93416"],["-58.53146","-34.96336"],["-58.53478","-34.96066"],["-58.55538","-34.9766"],["-58.53574","-34.99371"],["-58.5349","-35.02224"],["-58.53556","-35.02275"],["-58.53727","-35.02268"],["-58.53787","-35.02187"],["-58.55412","-35.00781"],["-58.5557","-35.00926"],["-58.55746","-35.00797"],["-58.60367","-34.9747"],["-58.62141","-34.96215"],["-58.61548","-34.95811"],["-58.60709","-34.95045"],["-58.61758","-34.93309"],["-58.62743","-34.91993"],["-58.64926","-34.89075"],["-58.64965","-34.8905"],["-58.65055","-34.89105"],["-58.65131","-34.89118"],["-58.65404","-34.89356"],["-58.65725","-34.89514"],["-58.65826","-34.89531"],["-58.65974","-34.89699"],["-58.66085","-34.89738"],["-58.66244","-34.89877"],["-58.6642","-34.89921"],["-58.66544","-34.90068"],["-58.66629","-34.90131"],["-58.66749","-34.90166"],["-58.66809","-34.90212"],["-58.66843","-34.903"],["-58.6703","-34.90318"],["-58.6714","-34.90378"],["-58.67225","-34.90454"],["-58.673","-34.90484"],["-58.67442","-34.90435"],["-58.67647","-34.90537"],["-58.67857","-34.90669"],["-58.67978","-34.90678"],["-58.68118","-34.90771"],["-58.68187","-34.90868"],["-58.68278","-34.90902"],["-58.68357","-34.9099"],["-58.68453","-34.91024"],["-58.68627","-34.91172"],["-58.68889","-34.91187"],["-58.69035","-34.91243"],["-58.69223","-34.91199"],["-58.69367","-34.91203"],["-58.70275","-34.90523"],["-58.70457","-34.90382"],["-58.71497","-34.89611"],["-58.7296","-34.88371"],["-58.75218","-34.86633"],["-58.76239","-34.85845"],["-58.74985","-34.84747"],["-58.77399","-34.82868"],["-58.77407","-34.828"],["-58.77357","-34.82726"],["-58.77261","-34.82767"],["-58.77153","-34.82756"],["-58.77033","-34.82691"],["-58.76861","-34.82669"],["-58.76733","-34.82683"],["-58.76605","-34.82745"],["-58.76542","-34.82744"],["-58.76339","-34.82695"],["-58.76014","-34.82676"],["-58.75881","-34.82648"],["-58.75772","-34.82673"],["-58.75702","-34.8272"],["-58.756","-34.82734"],["-58.75479","-34.82702"],["-58.75372","-34.82638"],["-58.75109","-34.82554"],["-58.7492","-34.82436"],["-58.74748","-34.82408"],["-58.74531","-34.82437"],["-58.7446","-34.82505"],["-58.74384","-34.82488"],["-58.74265","-34.82387"],["-58.74087","-34.82375"],["-58.7391","-34.82274"],["-58.73828","-34.82199"],["-58.73683","-34.82108"],["-58.73577","-34.81976"],["-58.73451","-34.81912"],["-58.7344","-34.81765"],["-58.73314","-34.817"],["-58.73199","-34.81741"],["-58.72995","-34.81744"],["-58.72893","-34.81769"],["-58.72816","-34.81826"],["-58.72634","-34.81832"],["-58.72419","-34.81772"],["-58.72329","-34.81803"],["-58.72182","-34.81807"],["-58.7196","-34.81794"],["-58.71808","-34.8175"],["-58.71682","-34.81654"],["-58.71485","-34.81642"],["-58.71404","-34.81525"],["-58.71208","-34.8146"],["-58.71051","-34.81301"],["-58.71039","-34.81222"],["-58.70958","-34.81169"],["-58.70868","-34.8121"],["-58.70785","-34.81214"],["-58.70653","-34.81108"],["-58.70631","-34.81067"],["-58.72746","-34.79561"],["-58.74214","-34.7841"],["-58.74306","-34.78328"],["-58.74857","-34.77893"],["-58.75111","-34.77699"],["-58.76093","-34.76936"],["-58.77028","-34.76205"],["-58.77572","-34.75861"],["-58.79296","-34.74782"],["-58.80551","-34.73981"],["-58.82576","-34.72699"],["-58.82948","-34.72462"],["-58.84045","-34.71638"],["-58.8537","-34.70631"],["-58.85409","-34.70174"],["-58.85499","-34.69863"],["-58.85618","-34.68615"],["-58.85809","-34.68702"],["-58.85896","-34.68702"],["-58.86039","-34.68735"],["-58.86089","-34.68771"],["-58.86308","-34.688"],["-58.86432","-34.68852"],["-58.8658","-34.68858"],["-58.86965","-34.68803"],["-58.88465","-34.69454"],["-58.89624","-34.69802"],["-58.90273","-34.70016"],["-58.90951","-34.70117"],["-58.91732","-34.69967"],["-58.92273","-34.69974"],["-58.93239","-34.70284"],["-58.9376","-34.70647"],["-58.94346","-34.71182"],["-58.9513","-34.71627"],["-58.95833","-34.72601"],["-58.96291","-34.73409"],["-58.96848","-34.74013"],["-58.98012","-34.74933"],["-58.98782","-34.75344"],["-58.99838","-34.76115"],["-59.00361","-34.7635"],["-59.01055","-34.76416"],["-59.0178","-34.76241"],["-59.01906","-34.7622"],["-59.02586","-34.76217"],["-59.0324","-34.76225"],["-59.03586","-34.76275"],["-59.04063","-34.76761"],["-59.07476","-34.73895"],["-59.07313","-34.73629"],["-59.09128","-34.7197"],["-59.09515","-34.72122"],["-59.09538","-34.72096"],["-59.09858","-34.72447"],["-59.10558","-34.73164"],["-59.11742","-34.75078"],["-59.12416","-34.75577"],["-59.13199","-34.76363"],["-59.13896","-34.77252"],["-59.14524","-34.78186"],["-59.15557","-34.78963"],["-59.16786","-34.80694"],["-59.17081","-34.80961"],["-59.17634","-34.80242"],["-59.23964","-34.72009"],["-59.26269","-34.69007"],["-59.24682","-34.68089"],["-59.28587","-34.62988"],["-59.28614","-34.62955"],["-59.27137","-34.62164"],["-59.30896","-34.56719"],["-59.34551","-34.51415"],["-59.29582","-34.48874"],["-59.227","-34.45349"],["-59.24866","-34.42451"],["-59.23851","-34.41526"],["-59.21835","-34.39974"],["-59.2069","-34.38439"],["-59.2045","-34.38142"],["-59.2018","-34.38309"],["-59.13949","-34.42693"],["-59.12887","-34.41967"],["-59.12896","-34.42117"],["-59.12833","-34.42267"],["-59.12059","-34.43274"],["-59.09583","-34.46655"],["-59.07449","-34.45318"],["-59.07762","-34.44701"],["-59.0739","-34.44527"],["-59.07379","-34.44297"],["-59.07036","-34.44145"],["-59.06949","-34.44305"],["-59.05845","-34.43738"],["-59.06098","-34.43343"],["-59.03911","-34.42269"],["-59.0427","-34.41768"],["-59.03404","-34.41313"],["-59.03719","-34.40855"],["-59.03111","-34.40548"],["-59.03587","-34.39873"],["-58.9967","-34.38171"],["-58.99771","-34.37816"],["-58.99276","-34.3765"],["-58.99113","-34.36513"],["-58.99579","-34.35806"],["-58.98228","-34.3503"],["-58.98065","-34.35213"],["-58.94055","-34.39736"],["-58.92364","-34.41705"],["-58.92323","-34.41667"],["-58.92331","-34.41558"],["-58.92194","-34.4156"],["-58.92093","-34.41457"],["-58.91942","-34.41471"],["-58.91888","-34.41376"],["-58.91882","-34.41312"],["-58.92002","-34.41236"],["-58.9202","-34.41173"],["-58.91903","-34.41045"],["-58.91916","-34.40936"],["-58.92086","-34.40772"],["-58.92173","-34.4076"],["-58.92195","-34.40702"],["-58.92138","-34.4065"],["-58.9222","-34.40565"],["-58.92223","-34.4051"],["-58.92005","-34.40377"],["-58.91983","-34.40335"],["-58.92041","-34.40255"],["-58.92216","-34.40206"],["-58.92229","-34.40171"],["-58.92211","-34.39973"],["-58.92255","-34.39911"],["-58.92247","-34.39813"],["-58.92267","-34.39688"],["-58.92185","-34.39597"],["-58.92198","-34.39446"],["-58.92337","-34.39371"],["-58.92328","-34.3928"],["-58.92171","-34.39256"],["-58.92127","-34.39182"],["-58.92126","-34.39101"],["-58.92241","-34.39054"],["-58.92153","-34.38995"],["-58.92192","-34.3881"],["-58.96936","-34.34003"],["-58.97448","-34.34008"],["-58.97516","-34.33137"],["-58.98076","-34.3266"],["-58.98584","-34.32895"],["-58.99468","-34.32042"],["-58.99923","-34.32115"],["-59.02171","-34.2967"],["-59.01884","-34.29426"],["-59.04209","-34.27155"],["-59.06158","-34.25254"],["-59.05623","-34.2495"],["-59.08125","-34.22793"],["-59.09306","-34.23274"],["-59.10748","-34.21886"],["-59.10671","-34.20417"],["-59.18734","-34.18996"],["-59.24178","-34.18033"],["-59.24059","-34.17504"],["-59.31304","-34.16458"],["-59.29836","-34.15801"],["-59.28244","-34.14964"],["-59.2766","-34.14042"],["-59.28086","-34.13002"],["-59.2802","-34.12691"],["-59.27858","-34.12334"],["-59.28117","-34.11361"],["-59.27724","-34.10739"],["-59.27351","-34.0952"],["-59.28218","-34.08471"],["-59.2944","-34.0771"],["-59.30027","-34.06934"],["-59.30598","-34.06456"],["-59.30697","-34.04907"],["-59.3104","-34.03694"],["-59.31259","-34.02686"],["-59.31505","-34.01506"],["-59.32095","-34.00397"],["-59.32925","-33.99945"],["-59.32842","-34.0008"],["-59.3255","-34.0172"],["-59.33663","-34.0339"],["-59.35267","-34.04283"],["-59.37269","-34.05272"],["-59.38904","-34.05958"],["-59.40612","-34.06106"],["-59.39816","-34.07215"],["-59.46765","-34.13599"],["-59.51469","-34.1017"],["-59.51555","-34.10108"],["-59.51552","-34.10446"],["-59.5199","-34.10884"],["-59.5271","-34.12229"],["-59.53613","-34.13106"],["-59.54214","-34.13947"],["-59.54658","-34.15509"],["-59.55289","-34.15948"],["-59.5647","-34.16722"],["-59.57725","-34.16889"],["-59.59312","-34.17148"],["-59.6076","-34.1735"],["-59.62806","-34.17014"],["-59.6382","-34.15928"],["-59.68067","-34.16874"],["-59.68115","-34.16898"],["-59.72561","-34.13206"],["-59.72164","-34.12667"],["-59.71699","-34.11839"],["-59.71539","-34.10898"],["-59.72352","-34.0872"],["-59.73117","-34.07421"],["-59.7348","-34.06808"],["-59.74731","-34.05011"],["-59.74819","-34.04036"],["-59.75056","-34.03577"],["-59.75432","-34.0281"],["-59.76184","-34.0131"],["-59.76048","-34.00988"],["-59.75608","-34.00734"],["-59.75185","-34.00113"],["-59.751","-33.99805"],["-59.75612","-34.00114"],["-59.76177","-34.00059"],["-59.76493","-34.00324"],["-59.77468","-34.00842"],["-59.78375","-34.01191"],["-59.7973","-34.00505"],["-59.86498","-33.95358"],["-59.87938","-33.94262"],["-59.91418","-33.91612"],["-59.99196","-33.85678"],["-60.02374","-33.83251"],["-60.02525","-33.83124"],["-60.04086","-33.8328"],["-60.05656","-33.82997"],["-60.06413","-33.8263"],["-60.07195","-33.82094"],["-60.08081","-33.8176"],["-60.08715","-33.81462"],["-60.091","-33.81302"],["-60.09815","-33.81704"],["-60.09856","-33.81968"],["-60.1064","-33.82061"],["-60.11177","-33.82016"],["-60.15637","-33.74915"],["-60.14657","-33.72052"],["-60.14395","-33.71651"],["-60.14356","-33.69262"],["-60.15222","-33.69171"],["-60.16515","-33.68896"],["-60.17684","-33.67599"],["-60.17561","-33.66681"],["-60.19514","-33.66361"],["-60.24651","-33.65522"],["-60.24541","-33.66234"],["-60.25426","-33.66112"],["-60.31348","-33.65297"],["-60.32001","-33.66001"],["-60.32497","-33.66907"],["-60.32759","-33.67412"],["-60.33492","-33.66854"],["-60.3844","-33.63089"],["-60.39101","-33.63582"],["-60.42488","-33.61097"],["-60.42886","-33.61579"],["-60.45962","-33.5935"],["-60.45945","-33.58959"],["-60.45917","-33.58664"],["-60.45872","-33.58367"],["-60.45416","-33.57603"],["-60.44716","-33.56931"],["-60.44227","-33.56503"],["-60.43958","-33.56303"],["-60.43671","-33.56126"],["-60.43349","-33.5602"],["-60.42986","-33.55992"],["-60.42352","-33.55795"],["-60.41923","-33.55304"],["-60.41599","-33.54782"],["-60.41558","-33.54186"],["-60.41743","-33.53618"],["-60.42001","-33.53063"],["-60.42132","-33.5248"],["-60.4205","-33.51891"],["-60.42077","-33.51303"],["-60.42095","-33.50715"],["-60.41859","-33.49543"],["-60.41691","-33.48968"],["-60.41492","-33.48399"],["-60.41354","-33.48043"],["-60.41174","-33.47551"],["-60.40997","-33.46976"],["-60.40862","-33.46389"],["-60.40619","-33.45837"],["-60.40172","-33.45379"],["-60.39829","-33.4527"],["-60.39506","-33.45152"],["-60.3924","-33.446"],["-60.38895","-33.44124"],["-60.38557","-33.44034"],["-60.38189","-33.43968"],["-60.37636","-33.43613"],["-60.37232","-33.43135"],["-60.36877","-33.43118"],["-60.36586","-33.42946"],["-60.36108","-33.42501"],["-60.35775","-33.42458"],["-60.3544","-33.42367"],["-60.3512","-33.42238"],["-60.34557","-33.4188"],["-60.34103","-33.41426"],["-60.33468"]]]]}'
)) AS valid;
答案 0 :(得分:2)
最后一个坐标缺少纬度:
... ["-60.34103","-33.41426"],["-60.33468"]
应该是
... ["-60.34103","-33.41426"],["-60.33468","your latitude here"]