geoJson मान्य नहीं है - जावास्क्रिप्ट, जेसन, geojson

मेरे पास निम्नलिखित geoJson बहुभुज हैं:

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[103.76772700000001,1.47063],[103.76772700000001,1.4795775862068967],[103.758794,1.4795775862068967],[103.758794,1.47063],[103.76772700000001,1.47063]]]]},"properties": {"number":"01"}},

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[104.00891800000001,1.47063],[104.00891800000001,1.4795775862068967],[103.99998500000001,1.4795775862068967],[103.99998500000001,1.47063],[104.00891800000001,1.47063]]]]},"properties": {"number":"03"}}

लेकिन जब मैं इसे मान्य करता हूं geojson सत्यापनकर्ता यह एक ईओएफ त्रुटि फेंकता है। लेकिन जब मैं प्रत्येक अलग से कोशिश करता हूं तो यह एक योग्य geoJSON के रूप में मान्य करता है। तो मैंने भी इसके साथ कोशिश की।

"type":"FeatureCollection","features":[

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[103.76772700000001,1.47063],[103.76772700000001,1.4795775862068967],[103.758794,1.4795775862068967],[103.758794,1.47063],[103.76772700000001,1.47063]]]]},"properties": {"number":"01"}},

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[104.00891800000001,1.47063],[104.00891800000001,1.4795775862068967],[103.99998500000001,1.4795775862068967],[103.99998500000001,1.47063],[104.00891800000001,1.47063]]]]},"properties": {"number":"03"}}

]

लेकिन अभी भी एक ईओएफ त्रुटि फेंक रहा है। किसी भी मदद की सराहना की है।

उत्तर:

उत्तर № 1 के लिए 1

यह एक JSON ऑब्जेक्ट होना चाहिए। आप गायब हैं { तथा }

{
"type": "FeatureCollection",
"features": [

{
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[103.76772700000001, 1.47063],
[103.76772700000001, 1.4795775862068967],
[103.758794, 1.4795775862068967],
[103.758794, 1.47063],
[103.76772700000001, 1.47063]
]
]
]
},
"properties": {
"number": "01"
}
},

{
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[104.00891800000001, 1.47063],
[104.00891800000001, 1.4795775862068967],
[103.99998500000001, 1.4795775862068967],
[103.99998500000001, 1.47063],
[104.00891800000001, 1.47063]
]
]
]
},
"properties": {
"number": "03"
}
}

]
}

संबंधित सवाल
सबसे लोकप्रिय