2

I'm a newbie at GIS programming and I have a problem with file conversion. I've tried to convert shp file to geojson, and the coordinates do not match. But when I try to convert it to kml, it goes well.

geojson output file result :

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

"features": [
{ "type": "Feature", "properties": { "KODEBPS": "3324010001", "KODE": "3324010001", "COUNT": 1, "DESA": "Blumah", "KECAMATAN": "Plantungan", "KABUPATEN": "Kendal", "PROPINSI": "Jawa Tengah", "KODEBPS_1": "3324010001", "KECAMATAN_1": "Plantungan", "KODE_KAB": "3324", "KABUPATEN_1": "Kendal", "KODE_PROP": 33.000000, "PROPINSI_1": "Jawa Tengah" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 383707.21875, 9211513.0 ], [ 383803.8125, 9211530.0 ], [ 383873.21875, 9211524.0 ], [ 383915.28125, 9211515.0 ], [ 383958.46875, 9211498.0 ], [ 383994.625, 9211437.0 ], [ 384024.78125, 9211391.0 ], [ 384035.125, 9211321.0 ], [ 384034.5625, 9211260.0 ], [ 384034.4375, 9211214.0 ], [ 384023.875, 9211146.0 ], [ 384013.5, 9211086.0 ], [ 384011.5625, 9211044.0 ], [ 384025.53125, 9210967.0 ], [ 384039.0625, 9210918.0 ], [ 384041.53125, 9210876.0 ], [ 384056.59375, 9210833.0 ], [ 384079.15625, 9210783.0 ], [ 384120.15625, 9210724.0 ], [ 384158.03125, 9210681.0 ], [ 384197.96875, 9210637.0 ], [ 384236.90625, 9210601.0 ], [ 384265.28125, 9210577.0 ], [ 384313.65625, 9210547.0 ], [ 384266.09375, 9210513.0 ], [ 384240.78125, 9210481.0 ], [ 384235.34375, 9210442.0 ], [ 384230.8125, 9210406.0 ], [ 384191.40625, 9210394.0 ], [ 384154.5, 9210371.0 ], [ 384110.375, 9210327.0 ], [ 384079.375, 9210290.0 ], [ 384069.53125, 9210244.0 ], [ 384039.65625, 9210212.0 ], [ 384011.75, 9210142.0 ], [ 383986.90625, 9210088.0 ], [ 383951.4375, 9210057.0 ], [ 383912.5625, 9210018.0 ], [ 383876.34375, 9209942.0 ], [ 383839.875, 9209902.0 ], [ 383799.625, 9209876.0 ], [ 383773.71875, 9209835.0 ], [ 383762.46875, 9209778.0 ], [ 383730.53125, 9209742.0 ], [ 383728.15625, 9209698.0 ], [ 383740.65625, 9209665.0 ], [ 383701.6875, 9209589.0 ], [ 383663.0, 9209559.0 ], [ 383620.5, 9209507.0 ], [ 383597.09375, 9209474.0 ], [ 383561.1875, 9209413.0 ], [ 383544.375, 9209380.0 ], [ 383521.625, 9209331.0 ], [ 383514.71875, 9209296.0 ], [ 383506.25, 9209235.0 ], [ 383508.4375, 9209195.0 ], [ 383517.875, 9209142.0 ], [ 383518.375, 9209083.0 ], [ 383511.4375, 9209038.0 ], [ 383506.53125, 9209002.0 ], [ 383491.25, 9208962.0 ], [ 383477.3125, 9208917.0 ], [ 383459.875, 9208876.0 ], [ 383433.125, 9208820.0 ], [ 383409.875, 9208768.0 ], [ 383385.46875, 9208731.0 ], [ 383362.21875, 9208680.0 ], [ 383338.96875, 9208608.0 ], [ 383318.03125, 9208551.0 ], [ 383304.09375, 9208494.0 ], [ 383291.3125, 9208436.0 ], [ 383270.375, 9208362.0 ], [ 383252.9375, 9208317.0 ], [ 383237.84375, 9208264.0 ], [ 383227.375, 9208209.0 ], [ 383214.59375, 9208154.0 ], [ 383205.28125, 9208105.0 ], [ 383199.46875, 9208067.0 ], [ 383189.0625, 9208019.0 ], [ 383177.96875, 9207948.0 ], [ 383172.375, 9207913.0 ], [ 383125.75, 9207878.0 ], [ 383096.09375, 9207798.0 ], [ 383085.6875, 9207749.0 ], [ 383069.875, 9207715.0 ], [ 383024.5, 9207682.0 ], [ 382986.75, 9207654.0 ], [ 382967.625, 9207621.0 ], [ 382952.84375, 9207581.0 ], [ 382938.90625, 9207490.0 ], [ 382929.53125, 9207439.0 ], [ 382917.5625, 9207380.0 ], [ 382910.03125, 9207312.0 ], [ 382887.9375, 9207252.0 ], [ 382854.21875, 9207184.0 ], [ 382826.34375, 9207132.0 ], [ 382804.25, 9207089.0 ], [ 382779.84375, 9207037.0 ], [ 382760.0625, 9206986.0 ], [ 382738.0, 9206918.0 ], [ 382706.59375, 9206831.0 ], [ 382671.71875, 9206732.0 ], [ 382634.53125, 9206652.0 ], [ 382601.96875, 9206579.0 ], [ 382561.3125, 9206478.0 ], [ 382525.25, 9206414.0 ], [ 382506.65625, 9206375.0 ], [ 382479.6875, 9206349.0 ], [ 382460.1875, 9206257.0 ], [ 382444.0, 9206214.0 ], [ 382428.84375, 9206182.0 ], [ 382408.03125, 9206146.0 ], [ 382384.6875, 9206099.0 ], [ 382369.59375, 9206064.0 ], [ 382347.0625, 9206027.0 ], [ 382317.1875, 9205999.0 ], [ 382274.65625, 9205979.0 ], [ 382240.21875, 9205962.0 ], [ 382196.75, 9205926.0 ], [ 382194.75, 9205877.0 ], [ 382202.875, 9205839.0 ], [ 382196.25, 9205790.0 ], [ 382171.625, 9205752.0 ], [ 382145.90625, 9205726.0 ], [ 382075.625, 9205678.0 ], [ 382051.65625, 9205643.0 ], [ 382051.46875, 9205607.0 ], [ 382045.4375, 9205561.0 ], [ 382006.9375, 9205486.0 ], [ 381983.53125, 9205453.0 ], [ 381965.65625, 9205420.0 ], [ 381938.375, 9205359.0 ], [ 381880.875, 9205371.0 ], [ 381845.0, 9205358.0 ], [ 381794.71875, 9205355.0 ], [ 381754.75, 9205339.0 ], [ 381722.34375, 9205317.0 ], [ 381695.125, 9205294.0 ], [ 381651.5625, 9205261.0 ], [ 381615.65625, 9205234.0 ], [ 381576.59375, 9205195.0 ], [ 381549.875, 9205167.0 ], [ 381518.90625, 9205138.0 ], [ 381482.3125, 9205108.0 ], [ 381444.71875, 9205106.0 ], [ 381407.40625, 9205135.0 ], [ 381372.53125, 9205164.0 ], [ 381329.21875, 9205206.0 ], [ 381289.53125, 9205252.0 ], [ 381248.625, 9205297.0 ], [ 381216.15625, 9205328.0 ], [ 381176.4375, 9205356.0 ], [ 381139.15625, 9205386.0 ], [ 381105.46875, 9205416.0 ], [ 381049.46875, 9205462.0 ], [ 381072.75, 9205530.0 ], [ 381131.40625, 9205525.0 ], [ 381190.65625, 9205550.0 ], [ 381255.15625, 9205586.0 ], [ 381273.15625, 9205620.0 ], [ 381299.09375, 9205659.0 ], [ 381323.78125, 9205698.0 ], [ 381345.28125, 9205732.0 ], [ 381387.5625, 9205778.0 ], [ 381428.5, 9205810.0 ], [ 381467.125, 9205841.0 ], [ 381507.90625, 9205876.0 ], [ 381528.25, 9205907.0 ], [ 381564.4375, 9205944.0 ], [ 381603.6875, 9205965.0 ], [ 381641.5, 9205998.0 ], [ 381673.71875, 9206020.0 ], [ 381695.53125, 9206054.0 ], [ 381730.65625, 9206085.0 ], [ 381760.71875, 9206112.0 ], [ 381801.40625, 9206161.0 ], [ 381832.8125, 9206182.0 ], [ 381866.09375, 9206202.0 ], [ 381883.78125, 9206246.0 ], [ 381895.9375, 9206285.0 ], [ 381903.09375, 9206325.0 ], [ 381908.78125, 9206365.0 ], [ 381910.3125, 9206439.0 ], [ 381898.75, 9206479.0 ], [ 381892.21875, 9206524.0 ], [ 381887.875, 9206579.0 ], [ 381886.84375, 9206616.0 ], [ 381900.46875, 9206659.0 ], [ 381914.6875, 9206705.0 ], [ 381934.3125, 9206742.0 ], [ 381961.34375, 9206774.0 ], [ 381992.6875, 9206807.0 ], [ 382008.625, 9206845.0 ], [ 382018.84375, 9206887.0 ], [ 382028.625, 9206931.0 ], [ 382039.5625, 9206986.0 ], [ 382059.8125, 9207044.0 ], [ 382075.8125, 9207095.0 ], [ 382089.90625, 9207136.0 ], [ 382117.6875, 9207183.0 ], [ 382164.34375, 9207187.0 ], [ 382195.4375, 9207208.0 ], [ 382213.25, 9207271.0 ], [ 382226.25, 9207311.0 ], [ 382237.875, 9207349.0 ], [ 382254.625, 9207415.0 ], [ 382289.125, 9207490.0 ], [ 382307.71875, 9207528.0 ], [ 382330.5, 9207564.0 ], [ 382372.375, 9207620.0 ], [ 382391.9375, 9207659.0 ], [ 382410.4375, 9207691.0 ], [ 382447.15625, 9207749.0 ], [ 382480.4375, 9207811.0 ], [ 382508.53125, 9207868.0 ], [ 382526.6875, 9207918.0 ], [ 382545.15625, 9207992.0 ], [ 382552.78125, 9208035.0 ], [ 382577.3125, 9208106.0 ], [ 382612.71875, 9208176.0 ], [ 382675.9375, 9208230.0 ], [ 382726.375, 9208232.0 ], [ 382781.34375, 9208295.0 ], [ 382795.875, 9208360.0 ], [ 382801.0625, 9208428.0 ], [ 382835.03125, 9208481.0 ], [ 382869.3125, 9208583.0 ], [ 382895.875, 9208628.0 ], [ 382936.09375, 9208699.0 ], [ 382932.59375, 9208773.0 ], [ 382931.40625, 9208883.0 ], [ 382937.125, 9208953.0 ], [ 382936.09375, 9208993.0 ], [ 382926.15625, 9209030.0 ], [ 382909.25, 9209104.0 ], [ 382902.4375, 9209146.0 ], [ 382886.375, 9209187.0 ], [ 382863.59375, 9209238.0 ], [ 382838.96875, 9209340.0 ], [ 382830.34375, 9209377.0 ], [ 382849.5625, 9209460.0 ], [ 382879.34375, 9209524.0 ], [ 382878.09375, 9209578.0 ], [ 382863.53125, 9209624.0 ], [ 382847.5625, 9209675.0 ], [ 382831.84375, 9209746.0 ], [ 382839.5, 9209812.0 ], [ 382866.4375, 9209843.0 ], [ 382888.3125, 9209889.0 ], [ 382902.8125, 9209923.0 ], [ 382944.625, 9210040.0 ], [ 382938.65625, 9210079.0 ], [ 382933.96875, 9210124.0 ], [ 382950.8125, 9210177.0 ], [ 382958.3125, 9210216.0 ], [ 382930.5625, 9210271.0 ], [ 382926.1875, 9210387.0 ], [ 382938.0, 9210449.0 ], [ 382985.28125, 9210495.0 ], [ 383019.46875, 9210576.0 ], [ 383073.8125, 9210611.0 ], [ 383112.25, 9210658.0 ], [ 383154.34375, 9210690.0 ], [ 383215.875, 9210706.0 ], [ 383285.6875, 9210790.0 ], [ 383343.46875, 9210853.0 ], [ 383357.8125, 9210904.0 ], [ 383380.6875, 9210959.0 ], [ 383378.625, 9210999.0 ], [ 383379.75, 9211062.0 ], [ 383436.8125, 9211095.0 ], [ 383449.6875, 9211136.0 ], [ 383471.78125, 9211187.0 ], [ 383500.3125, 9211220.0 ], [ 383533.0, 9211279.0 ], [ 383637.4375, 9211296.0 ], [ 383677.75, 9211329.0 ], [ 383705.78125, 9211362.0 ], [ 383731.3125, 9211392.0 ], [ 383753.6875, 9211424.0 ], [ 383738.75, 9211469.0 ], [ 383707.21875, 9211513.0 ] ] ] } } ] }

and this is the kml output result :

<Placemark>
<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill>
</PolyStyle></Style>
<ExtendedData><SchemaData schemaUrl="#a">
    <SimpleData name="KODEBPS">3324010001</SimpleData>
    <SimpleData name="KODE">3324010001</SimpleData>
    <SimpleData name="COUNT">1</SimpleData>
    <SimpleData name="DESA">Blumah</SimpleData>
    <SimpleData name="KECAMATAN">Plantungan</SimpleData>
    <SimpleData name="KABUPATEN">Kendal</SimpleData>
    <SimpleData name="PROPINSI">Jawa Tengah</SimpleData>
    <SimpleData name="KODEBPS_1">3324010001</SimpleData>
    <SimpleData name="KECAMATAN_1">Plantungan</SimpleData>
    <SimpleData name="KODE_KAB">3324</SimpleData>
    <SimpleData name="KABUPATEN_1">Kendal</SimpleData>
    <SimpleData name="KODE_PROP">33</SimpleData>
    <SimpleData name="PROPINSI_1">Jawa Tengah</SimpleData>
</SchemaData></ExtendedData>
  <Polygon><altitudeMode>relativeToGround</altitudeMode><outerBoundaryIs><LinearRing><altitudeMode>relativeToGround</altitudeMode><coordinates>-52.78125,9211513.0 43.8125,9211530.0 113.21875,9211524.0 155.28125,9211515.0 -161.53125,9211498.0 -125.375,9211437.0 -95.21875,9211391.0 -84.875,9211321.0 -85.4375,9211260.0 -85.5625,9211214.0 -96.125,9211146.0 -106.5,9211086.0 -108.4375,9211044.0 -94.46875,9210967.0 -80.9375,9210918.0 -78.46875,9210876.0 -63.40625,9210833.0 -40.84375,9210783.0 0.15625,9210724.0 38.03125,9210681.0 77.96875,9210637.0 116.90625,9210601.0 145.28125,9210577.0 -166.34375,9210547.0 146.09375,9210513.0 120.78125,9210481.0 115.34375,9210442.0 110.8125,9210406.0 71.40625,9210394.0 34.5,9210371.0 -9.625,9210327.0 -40.625,9210290.0 -50.46875,9210244.0 -80.34375,9210212.0 -108.25,9210142.0 -133.09375,9210088.0 -168.5625,9210057.0 152.5625,9210018.0 116.34375,9209942.0 79.875,9209902.0 39.625,9209876.0 13.71875,9209835.0 2.46875,9209778.0 -29.46875,9209742.0 -31.84375,9209698.0 -19.34375,9209665.0 -58.3125,9209589.0 -97,9209559 -139.5,9209507.0 -162.90625,9209474.0 161.1875,9209413.0 144.375,9209380.0 121.625,9209331.0 114.71875,9209296.0 106.25,9209235.0 108.4375,9209195.0 117.875,9209142.0 118.375,9209083.0 111.4375,9209038.0 106.53125,9209002.0 91.25,9208962.0 77.3125,9208917.0 59.875,9208876.0 33.125,9208820.0 9.875,9208768.0 -14.53125,9208731.0 -37.78125,9208680.0 -61.03125,9208608.0 -81.96875,9208551.0 -95.90625,9208494.0 -108.6875,9208436.0 -129.625,9208362.0 -147.0625,9208317.0 -162.15625,9208264.0 -172.625,9208209.0 174.59375,9208154.0 165.28125,9208105.0 159.46875,9208067.0 149.0625,9208019.0 137.96875,9207948.0 132.375,9207913.0 85.75,9207878.0 56.09375,9207798.0 45.6875,9207749.0 29.875,9207715.0 -15.5,9207682.0 -53.25,9207654.0 -72.375,9207621.0 -87.15625,9207581.0 -101.09375,9207490.0 -110.46875,9207439.0 -122.4375,9207380.0 -129.96875,9207312.0 -152.0625,9207252.0 174.21875,9207184.0 146.34375,9207132.0 124.25,9207089.0 99.84375,9207037.0 80.0625,9206986.0 58,9206918 26.59375,9206831.0 -8.28125,9206732.0 -45.46875,9206652.0 -78.03125,9206579.0 -118.6875,9206478.0 -154.75,9206414.0 -173.34375,9206375.0 159.6875,9206349.0 140.1875,9206257.0 124,9206214 108.84375,9206182.0 88.03125,9206146.0 64.6875,9206099.0 49.59375,9206064.0 27.0625,9206027.0 -2.8125,9205999.0 -45.34375,9205979.0 -79.78125,9205962.0 -123.25,9205926.0 -125.25,9205877.0 -117.125,9205839.0 -123.75,9205790.0 -148.375,9205752.0 -174.09375,9205726.0 115.625,9205678.0 91.65625,9205643.0 91.46875,9205607.0 85.4375,9205561.0 46.9375,9205486.0 23.53125,9205453.0 5.65625,9205420.0 -21.625,9205359.0 -79.125,9205371.0 -115,9205358 -165.28125,9205355.0 154.75,9205339.0 122.34375,9205317.0 95.125,9205294.0 51.5625,9205261.0 15.65625,9205234.0 -23.40625,9205195.0 -50.125,9205167.0 -81.09375,9205138.0 -117.6875,9205108.0 -155.28125,9205106.0 167.40625,9205135.0 132.53125,9205164.0 89.21875,9205206.0 49.53125,9205252.0 8.625,9205297.0 -23.84375,9205328.0 -63.5625,9205356.0 -100.84375,9205386.0 -134.53125,9205416.0 169.46875,9205462.0 -167.25,9205530.0 -108.59375,9205525.0 -49.34375,9205550.0 15.15625,9205586.0 33.15625,9205620.0 59.09375,9205659.0 83.78125,9205698.0 105.28125,9205732.0 147.5625,9205778.0 -171.5,9205810.0 -132.875,9205841.0 -92.09375,9205876.0 -71.75,9205907.0 -35.5625,9205944.0 3.6875,9205965.0 41.5,9205998.0 73.71875,9206020.0 95.53125,9206054.0 130.65625,9206085.0 160.71875,9206112.0 -158.59375,9206161.0 -127.1875,9206182.0 -93.90625,9206202.0 -76.21875,9206246.0 -64.0625,9206285.0 -56.90625,9206325.0 -51.21875,9206365.0 -49.6875,9206439.0 -61.25,9206479.0 -67.78125,9206524.0 -72.125,9206579.0 -73.15625,9206616.0 -59.53125,9206659.0 -45.3125,9206705.0 -25.6875,9206742.0 1.34375,9206774.0 32.6875,9206807.0 48.625,9206845.0 58.84375,9206887.0 68.625,9206931.0 79.5625,9206986.0 99.8125,9207044.0 115.8125,9207095.0 129.90625,9207136.0 157.6875,9207183.0 -155.65625,9207187.0 -124.5625,9207208.0 -106.75,9207271.0 -93.75,9207311.0 -82.125,9207349.0 -65.375,9207415.0 -30.875,9207490.0 -12.28125,9207528.0 10.5,9207564.0 52.375,9207620.0 71.9375,9207659.0 90.4375,9207691.0 127.15625,9207749.0 160.4375,9207811.0 -171.46875,9207868.0 -153.3125,9207918.0 -134.84375,9207992.0 -127.21875,9208035.0 -102.6875,9208106.0 -67.28125,9208176.0 -4.0625,9208230.0 46.375,9208232.0 101.34375,9208295.0 115.875,9208360.0 121.0625,9208428.0 155.03125,9208481.0 -170.6875,9208583.0 -144.125,9208628.0 -103.90625,9208699.0 -107.40625,9208773.0 -108.59375,9208883.0 -102.875,9208953.0 -103.90625,9208993.0 -113.84375,9209030.0 -130.75,9209104.0 -137.5625,9209146.0 -153.625,9209187.0 -176.40625,9209238.0 158.96875,9209340.0 150.34375,9209377.0 169.5625,9209460.0 -160.65625,9209524.0 -161.90625,9209578.0 -176.46875,9209624.0 167.5625,9209675.0 151.84375,9209746.0 159.5,9209812.0 -173.5625,9209843.0 -151.6875,9209889.0 -137.1875,9209923.0 -95.375,9210040.0 -101.34375,9210079.0 -106.03125,9210124.0 -89.1875,9210177.0 -81.6875,9210216.0 -109.4375,9210271.0 -113.8125,9210387.0 -102,9210449 -54.71875,9210495.0 -20.53125,9210576.0 33.8125,9210611.0 72.25,9210658.0 114.34375,9210690.0 175.875,9210706.0 -114.3125,9210790.0 -56.53125,9210853.0 -42.1875,9210904.0 -19.3125,9210959.0 -21.375,9210999.0 -20.25,9211062.0 36.8125,9211095.0 49.6875,9211136.0 71.78125,9211187.0 100.3125,9211220.0 133,9211279 -122.5625,9211296.0 -82.25,9211329.0 -54.21875,9211362.0 -28.6875,9211392.0 -6.3125,9211424.0 -21.25,9211469.0 -52.78125,9211513.0</coordinates></LinearRing></outerBoundaryIs></Polygon>

the coordinate is much different. *I'm using qgis

3

To find out the right CRS, create a new project in QGIS with project CRS set to EPSG:3857, load Google or OpenStreetMap background from the Openlayers plugin, and look where your data is placed.

If you set the Layer CRS of your data to EPSG:32749 WGS 84 / UTM zone 49S, your data will be placed in the right position (at least the same place a Google search for the names takes you):

enter image description here

With that source CRS, you can convert the data to kml. You have to select WGS84 as output CRS for kml.

2

Those input points are not in urn:ogc:def:crs:OGC:1.3:CRS84, since that is (roughly) WGS84 lon / lat, and (taking the first point): [ 383707.21875, 9211513.0 ] is not a reasonable lon / lat combination.

What QGIS is (probably) doing in converting that point to -52.78125,9211513.0 is taking 383707 and wrapping it around a few times (383707.2185 - 1066 * 360 = -52.78125). The second coordinate is still not reasonable.

Shapefiles don't have mandatory coordinate reference system. So you need to figure out what the real coordinate reference system is for your data, and put that into your JSON, or transform the shapefile first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.