Developing an example based on Sharpmap Extender

Source: Internet
Author: User

Sharpmap is a GIS map rendering component developed on the. NET platform. A geometric model framework based on OGC Standard is designed in Sharpmap, and a multi source vector map data adapter interface for Iprovider Strategy mode is designed, and the bottom layer of MAP element rendering is mainly changed by geometry. To convert geometry to. NET-supported geometric models such as System.Drawing.Point, System.Drawing.Rectangle, System.Drawing.Drawing2D.GraphicsPath and so on, then calls the System.Drawing.Graphics class draw method to realize the map element drawing. Within the Sharpmap because there is no architecture for symbol design, for the need to develop a real GIS system, you need to encapsulate the symbol architecture to achieve the thematic rendering and map symbol library.

Sharpmap provides us with the most basic functions of the GIS system, such as map visualization, spatial query and so on, so we can use some of the features provided by SHARPMAP to support our map visualization on the. NET platform without the need of some commercial components. This article will introduce some code examples based on SHARPMAP implementation part of the program, hope to study open source friend have enlightenment and help. Note: I have modified the sharpmap part of the bug, redesigned the architecture of the system, and developed some new modules. These will be elaborated in later articles.

Example of developing Windows applications based on Jackey.framework

Initialize the code, call the method in the form Mount event.

            private void Init () {//set buddy control.

            This.tocControl1.MapControl = This.mapcontrol1;

            Create a vector layer and set the default renderer.

            SharpMap.Layers.VectorLayer laycity=new SharpMap.Layers.VectorLayer ("City"); Laycity.datasource=new SharpMap.Data.Providers.ShapeFileProvider (@ "D:" ArcGIS "Developerkit" samplesnet "Data"

            Gulfofstlawrence "Data" can_mjr_cities.shp "); ((SharpMap.Rendering.SimpleFeatureRenderer) laycity.renderer).

            Symbol=new SharpMap.Symbols.MarkerSymbol (sharpmap.symbols.symboltype.circle,color.blue,10f);

            Create a vector layer and set the default renderer.

            SharpMap.Layers.VectorLayer layroad = new SharpMap.Layers.VectorLayer ("Road"); Layroad.datasource = new SharpMap.Data.Providers.ShapeFileProvider (@ "D:" ArcGIS "Developerkit" samplesnet "Data"

            Gulfofstlawrence "Data" mjrroads.shp "); ((Sharpmap.renderiNg. Simplefeaturerenderer) layroad.renderer).

            Symbol = new SharpMap.Symbols.LineSymbol (color.green, 2f);

            Create a vector layer and set the default renderer.

            SharpMap.Layers.VectorLayer laycoasts = new SharpMap.Layers.VectorLayer ("coasts"); Laycoasts.datasource = new SharpMap.Data.Providers.ShapeFileProvider (@ "D:" ArcGIS "Developerkit" samplesnet "Data"

            Gulfofstlawrence "Data" coasts.shp "); ((SharpMap.Rendering.SimpleFeatureRenderer) laycoasts.renderer).

            Symbol = new SharpMap.Symbols.FillSymbol (Color.lightcyan);

            Add the layer to the map this.mapControl1.Map.Layers.Add (laycoasts);

            THIS.MAPCONTROL1.MAP.LAYERS.ADD (Layroad);

            THIS.MAPCONTROL1.MAP.LAYERS.ADD (laycity);

        Zoom the "map to" full extent this.mapControl1.ZoomToFullExtent (); }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.