Incorrect data by osm2pgsql for multipolygons
I try to convert Europe OSM data to my postgis database and observe that some countries like Greece or Russia are imported incorrectly.
It seems that it takes only part of their geometries. For example, there is only two separate islands for Greece in my database after osm2pgsql import.
It's very strange. I tried to use different arguments and got the same result. I use the latest version osm2pgsql from SVN 0.69-23858 and osm file from Geofabrik.
osm2pgsql -d osm2pgsql_greece -S ~/osm/default.style -U postgres -W -H localhost -G --slim ~/osm/greece.osm
SELECT ST_AsText(way) FROM planet_osm_polygon p WHERE p.admin_level = '2'
Result: MULTIPOLYGON(((2656334.92 4156335.71,2656423.97 4157233.27,2656571.36 4158123.17,2656776.41 4159001.45,2657038.12 4159864.59,2657355.61 4160708.64,2657727.52 4161530.2,2658152.1 4162325.46,2658627.54 4163091.29,2659151.97 4163824.14,2659723.15 4164521.04,2660338.41 4165178.97,2660995.42 4165795.07,2661691.05 4166366.63,2662422.65 4166891.32,2662947.63 4167225.31,2663012.75 4167264.73,2663251.98 4167406.11,2664045.57 4167830.24,2664865.11 4168201.38,2665707.13 4168517.74,2666567.96 4168777.95,2667443.93 4168981.07,2668331.37 4169126.14,2669226.27 4169212.61,2670090.11 4169239.94,2670351.6 4169239.94,2670386.44 4169239.8,2671284.9 4169207.99,2672179.47 4169117.03,2673066.01 4168967.48,2673940.98 4168759.87,2674800.59 4168495.17,2675640.94 4168174.6,2676458.59 4167799.39,2676567.35 4167744.46,2676589.05 4167735.36,2677406.69 4167360.02,2678198.06 4166931.82,2678287.9 4166877.72,2678851.73 4166572.56,2679613.38 4166093.15,2679903.48 4165891.44,2680266.94 4165653.99,2680995.63 4165125.55,2681688.26 4164550.39,2682341.82 4163930.82,2682532.81 4163724.44,2682953.63 4163269.71,2683521.03 4162569.77,2683782.13 4162200.76,2684041.56 4161834.14,2684135.98 4161680.28,2684513 4161065.95,2684933.34 4160268.47,2685089.41 4159936.18,2685163.44 4159769.36,2685718.36 4159675.08,2686592.22 4159466.7,2687450.72 4159201.13,2687485.34 4159189.18,2687810.39 4159081.32,2688649.63 4158759.8,2689466.16 4158383.95,2689741.01 4158242.29,2689858.45 4158184.15,2689873.36 4158176.68,2690414.82 4157961.94,2691231.13 4157585.99,2692021.27 4157156.94,2692781.59 4156676.99,2693509.06 4156148.16,2694200.35 4155572.52,2694852.69 4154952.77,2695463.16 4154291.37,2695699.38 4154010.72,2695732 4153970.8,2696061.95 4153551.53,2696581.14 4152815.82,2697051.25 4152047.71,2697462.35 4151266.62,2697540.38 4151131.02,2697959.28 4150333.71,2698325.41 4149510.67,2698636.99 4148665.29,2698892.91 4147801.39,2699091.95 4146922.5,2699233.33 4146032.55,2699316.49 4145135.35,2699341.2 4144290.44,2699341.09 4144170.93,2699340.86 4144115.04,2699306.69 4143214.73,2699300.46 4143129.95,2699544.02 4142455.28,2699799.61 4141591.87,2699998.54 4140713.6,2700139.69 4139824.14,2700222.74 4138927.43,2700247.34 4138084.08,2700246.78 4137726.15,2700246.67 4137669.35,2700212.38 4136769.56,2700119.66 4135874.05,2699968.82 4134986.6,2699760.65 4134111.02,2699495.82 4133251.09,2699175.78 4132410.47,2698801.63 4131592.82,2698375.17 4130801.37,2697898.05 4130039.79,2697372.51 4129311.18,2697189.95 4129079.92,2697157.44 4129039.55,2696768.27 4128578.41,2696152.67 4127924.94,2695496 4127313.36,2694800.92 4126746.24,2694070.55 4126225.88,2693445.94 4125834.87,2693091.28 4125591.23,2692643.55 4125306.15,2692578.43 4125266.47,2692263.62 4125080.13,2691472.13 4124660.05,2690654.94 4124292.66,2689815.7 4123979.72,2688957.98 4123722.45,2688085.24 4123522.18,2687201.47 4123379.46,2686310.36 4123295.11,2685471.46 4123269.25,2685210.64 4123269.25,2685154.75 4123269.38,2684260.19 4123302.42,2683369.75 4123394.09,2682487.2 4123543.85,2681616.13 4123751.42,2681538.43 4123772.82,2681159.39 4123870.58,2680303.67 4124134.77,2679467 4124454.49,2678652.8 4124828.51,2677864.77 4125255.1,2677642.02 4125388.09,2677576.9 4125427.77,2677040.9 4125772.3,2676314.76 4126298.47,2676160.47 4126420.1,2675783.43 4126590.21,2675226.95 4126852.57,2674438.58 4127278.96,2674412.09 4127294.54,2673921.95 4127527.11,2673133.47 4127953.52,2672374.27 4128430.62,2672099.98 4128620.82,2671721.61 4128867.37,2670995.03 4129393.41,2670304.18 4129965.95,2670254.75 4130009.98,2669689.36 4130425.38,26689开发者_Python百科98.4 4130997.98,2668712.64 4131258.27,2668456.16 4131492.28,2668247.33 4131673.31,2667594.99 4132290.14,2666984.07 4132948.34,2666474.9 4133570.12,2665984.87 4134205.49,2665927.21 4134280.71,2665807.31 4134440.92,2665318.29 4134974.27,2665105.56 4135225.03,2665072.61 4135264.74,2664718.39 4135711.11,2664197.86 4136443.93,2663725.97 4137209.48,2663305.08 4138004.36,2662936.61 4138825.2,2662622.46 4139668.61,2662363.76 4140530.93,2662161.71 4141408.5,2662017.22 4142297.41,2661930.95 4143194.11,2661920.26 4143522.92,2661883.97 4143561.98,2661839.89 4143614.21,2661287.41 4144135.79,2660675.49 4144794.42,2660639.64 4144835.8,2660503.72 4144970.78,2659891.69 4145629.32,2659323.62 4146326.84,2658802.2 4147060.09,2658329.54 4147826.09,2657907.64 4148621.6,2657538.5 4149443.08,2657223.47 4150287.15,2657169.37 4150451.52,2657059.72 4150764.8,2656800.23 4151627.84,2656597.52 4152506.15,2656503.93 4153067.25,2656334.92 4156335.71)),((2323144.44 4475744.31,2323152.45 4476244.08,2323214.01 4477171.93,2323335.91 4478093.71,2323517.58 4479005.63,2323758.25 4479903.78,2324057.03 4480784.24,2324412.48 4481643.35,2324823.25 4482477.21,2325287.45 4483282.43,2325803.19 4484055.38,2326368.25 4484792.83,2326980.28 4485491.69,2327636.51 4486148.74,2328334.26 4486761.3,2329070.42 4487326.7,2329782.86 4487805.6,2329848.32 4487846.77,2329907.43 4487883.74,2330711.05 4488347.82,2331543.16 4488758,2332400.32 4489112.6,2332972.61 4489313.71,2333638.19 4489533.03,2334534.2 4489772.11,2335443.79 4489951.67,2336363.29 4490071.14,2337288.58 4490129.82,2338215.65 4490127.44,2339140.71 4490064.13,2340059.55 4489940.18,2340968.25 4489756,2341042.72 4489738.08,2341328.03 4489673.51,2342222.82 4489429.95,2343099.68 4489128.14,2343955.06 4488769.2,2344785.17 4488354.82,2345586.45 4487886.82,2346355.44 4487367.17,2347088.81 4486797.98,2347783.45 4486181.92,2348436.45 4485521.51,2349045.03 4484819.57,2349606.42 4484079.32,2349965.76 4483534.66,2349991.58 4483504.99,2350110.47 4483356.34,2350142.98 4483315.18,2350585.36 4482723.54,2351097.21 4481948.03,2351557.29 4481140.53,2351963.72 4480304.68,2352246.91 4479623.37,2352343.99 4479378.79,2352510.19 4478951.07,2352804.4 4478069.23,2353040.51 4477169.97,2353217.51 4476257.23,2353334.62 4475334.91,2353391.39 4474406.95,2353397.29 4473978.72,2353396.96 4473773.29,2353387.38 4473271.96,2353323.15 4472344.73,2353198.7 4471423.73,2353014.46 4470513.02,2352771.45 4469616.37,2352470.56 4468737.69,2352113.11 4467880.74,2351700.78 4467049.02,2351235.13 4466246.44,2350718.39 4465476.05,2350263.09 4464877.16,2350197.63 4464795.7,2350087.21 4464659.75,2349474.84 4463963.8,2348818.61 4463309.54,2348799.91 4463293.19,2348121.19 4462699.74,2347599.88 4462293.08,2347222.73 4462014.12,2346452.18 4461500.91,2345650.01 4461039.27,2344819.57 4460631.29,2343964.41 4460278.76,2343088.1 4459983.09,2342194.54 4459745.53,2341287.4 4459567.05,2340675.7 4459481.16,2339783.47 4459366.5,2338860.97 4459308.27,2337936.57 4459310.64,2337014.4 4459373.76,2336098.24 4459497.08,2335192.1 4459680.31,2334299.76 4459922.62,2333425.13 4460222.9,2323211.34 4474140.11,2323151.78 4475067.91,2323144.77 4475497.72,2323144.44 4475744.31)))
I don't have much to suggest other than: have you tried the other formats provided by OSM? Eg. use their shape files and try importing them with sph2postgresql? (I also here ogr2ogr might do it).
You will probably lose much of the descriptive information, but it might be a guide as to whether the missing shapes really are there?
精彩评论