Import file.SHP Projection problems
Import file.SHP Projection problems
ref1: https://mathematica.stackexchange.com/questions/124121/geoposition-coordinates-from-shape-file-shp-with-unknown-datum
ref2: https://reference.wolfram.com/language/guide/GeographicData.html
ref3: https://mathematica.stackexchange.com/questions/195304/loading-data-from-a-shapefile
ref4: https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system#UTM_zone
ref5: https://mathematica.stackexchange.com/questions/42533/latitude-longitude-to-transverse-mercator-projection
ref6: https://mathematica.stackexchange.com/questions/18311/plotting-a-latitude-longitude-list-on-top-of-a-gis-shapefile
ref7:
ref2: https://reference.wolfram.com/language/guide/GeographicData.html
ref3: https://mathematica.stackexchange.com/questions/195304/loading-data-from-a-shapefile
ref4: https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system#UTM_zone
ref5: https://mathematica.stackexchange.com/questions/42533/latitude-longitude-to-transverse-mercator-projection
ref6: https://mathematica.stackexchange.com/questions/18311/plotting-a-latitude-longitude-list-on-top-of-a-gis-shapefile
ref7:
Belgium
Belgium
Download “belgSHPsite” and unzip
belgSHPsite=”https://statbel.fgov.be/sites/default/files/files/opendata/Statistische%20sectoren/sh_statbel_statistical_sectors_20200101.shp.zip”
belgSHPsite=”https://statbel.fgov.be/sites/default/files/files/opendata/Statistische%20sectoren/sh_statbel_statistical_sectors_20200101.shp.zip”
In[]:=
ClearAll["Global`*"]SetDirectory[NotebookDirectory[]];
In[]:=
belgSHP=File["sh_statbel_statistical_sectors_20200101.shp/"];
In[]:=
(*follwingtakesawhile*)belgElements=AssociationThread[#,Import[belgSHP,{#}]]&@Cases[Import[belgSHP,"Elements"],Except["Data"]];
In[]:=
Normal[belgElements]//Column
(*extractprojectionfromSHP*)projb1=Lookup["Projection"]@belgElements
(*usedBESSEL1841forReferenceModel*)projb2={"LambertConformalConic","Centering"GeoPosition[{90.,4.36748666666667}],"GridOrigin"{150000.013,5.400088438*^6},"StandardParallels"{51.1666672333333,49.8333339},"ReferenceModel""Bessel1841"}
In[]:=
(*follwingtakesawhile*)belgAreas="Geometry"/.Import[belgSHP,{"SHP","Data"}];
In[]:=
aartselaar=Take[First@belgAreas,16];
In[]:=
Graphics[aartselaar]
In[]:=
belgPlot=GeoGraphics[{EdgeForm[Directive[Blue,Opacity[.5]]],FaceForm[None],aartselaar/.{Polygon[a__]Polygon@GeoPosition@GeoGridPosition[a,projb1],Line[a__]Line@GeoPosition@GeoGridPosition[a,projb1]}}];
In[]:=
belgPlot=GeoGraphics[{EdgeForm[Directive[Blue,Opacity[.5]]],FaceForm[None],aartselaar/.{Polygon[a__]Polygon@GeoPosition@GeoGridPosition[a,projb2],Line[a__]Line@GeoPosition@GeoGridPosition[a,projb2]}}];belgPlot
In[]:=
List@@belgPlot//Column
Netherlands
Netherlands
In[]:=
amstSHP="http://maps.amsterdam.nl/gebiedsindeling/GEBIEDSINDELINGEN.ZIP";
In[]:=
amstElements=AssociationThread[#,Import[amstSHP,{#}]]&@Cases[Import[amstSHP,"Elements"],Except["Data"]];Normal[amstElements]//Column
In[]:=
(*multipleerrorsinamstpPlot*)projnSHP1=Lookup["Projection"]@amstElements
(*fromprojnSHP1,delete"Double"*)projnSHP2={"Stereographic","Centering"GeoPosition[{52.1562,5.38764}],"CentralScaleFactor"0.999908,"GridOrigin"{155000,463000},"StandardParallels"None,"ReferenceModel"{Quantity[6.35608*10^6,"Meters"],Quantity[6.3774*10^6,"Meters"]}};
In[]:=
(*fromprojnSHP1,delete"Double"anduseBessel1841*)projnSHP3={"Stereographic","Centering"GeoPosition[{52.1562,5.38764}],"CentralScaleFactor"0.999908,"GridOrigin"{155000,463000},"StandardParallels"None,"ReferenceModel""Bessel1841"};
(*fromexempleX*)projnX2={"Stereographic","ReferenceModel""Bessel1841","GridOrigin"{155000,463000},"Centering"{52.1562,5.38764},"CentralScaleFactor"0.999908};
In[]:=
amstAreas="Geometry"/.Import[amstSHP,{"SHP","Data"}];
In[]:=
amstPlot=GeoGraphics[{EdgeForm[Directive[Blue,Opacity[.5]]],FaceForm[None],First@amstAreas/.{Polygon[a__]Polygon@GeoPosition@GeoGridPosition[a,projnSHP2],Line[a__]Line@GeoPosition@GeoGridPosition[a,projnSHP2]}}];
In[]:=
amstPlot=GeoGraphics[{EdgeForm[Directive[Blue,Opacity[.5]]],FaceForm[None],First@amstAreas/.{Polygon[a__]Polygon@GeoPosition@GeoGridPosition[a,projnSHP3],Line[a__]Line@GeoPosition@GeoGridPosition[a,projnSHP3]}}];
In[]:=
amstPlot=GeoGraphics[{EdgeForm[Directive[Blue,Opacity[.5]]],FaceForm[None],First@amstAreas/.{Polygon[a__]Polygon@GeoPosition@GeoGridPosition[a,projnX2],Line[a__]Line@GeoPosition@GeoGridPosition[a,projnX2]}}]
In[]:=
List@@amstPlot//Column