When working with Mapviewer, you may face with the need to have map data to begin to work. The demo files come with some data but are really without utility if you work in an other country than the US.
Shapefile are really well spread out on the internet and easy to find.
You can load them:
- with an User Interface threough the mapbuilder tool. See steps below
- with a Script with the Shapefile Converter (SampleShapefileToJGeomFeature)
For instance, in the Netherlands, you will find on the CBS website (statistic bureau/office is always a good place to search) free of charge the map for the country on three levels.
Example of Nederlands administrative levels :
- het rijk,
- de provincie
- de gemeente
But you can find others type of levels such as:
- de wijk
- de buurt
- de postcode
I will show you how to import the map for the level gemeente.
Add a connection where you want to store your spatial data.
You will find the utility in the menu.
Give all the data, particulary the location of the shapefile.
Be careful with the SRID ! You can:
- get it by uploading your PRJ file in this lookup web site
- or just leave 0 if it's unknown (according to the documentation of the Shapefile Converter utility)
Create a theme to allow the preview and to begin to construct a futur map.
If you go to the preview tab and click on the green arrow, you will then see the Netherlands by “gemeente” :