Nevron Diagram for .NET - Maps

Introduction
Nowadays the globalization process is stronger than ever and many companies sell products and services all over theworld. That’s why software applications in many areas need to provide geographical and mapping information to the end
users. World’s most popular format for storing such information is the ESRI shapefile. There are hundreds of freely
available ESRI maps on the web and now you can easily take advantage of them using Nevron Diagram and its integrated
mapping features. All you have to do is to put our diagramming component in your project and your mapping solution is justa few lines of code away. Nevron Diagram for .NET Maps will enhance your .NET desktop or Web-based applications byadding intuitive, user-friendly and interactive Maps and geographical data, extending the Diagram to provide sophisticatedgraphs for your specific business needs.

Visualize Your Successwww.nevron.com

sales@nevron.com

1-888-201-6088

How to add a map
To import maps in you diagrams just follow these simple steps:
1. Create an object of type NEsriMap that will host the geographical data.
2. Add the ESRI shapefiles you want to load one by one using the Add method of the map. The Add method returns
the created shapefile in case you want to set some of its properties:o EnableZoomInRange - Gets/Sets whether the objects from the file should only be shown if the current
zoom factor is in the Min/Max Zoom factor range specified by the MinShowZoomFactor andMaxShowZoomFactor properties.
o NameColumn - Determines the data column from the DBF file to use for naming of the diagram elementsthat are created from this shapefile.
3. When finished adding shapefiles to the map, call the Read method to load the data.
4. Call the ImportShapes method to import the loaded shapes in the document. You can control the importing
process using the ShapeImporter of the map that has the following properties:
o PolygonsAsShapes, PolylinesAsShapes - determine whether to render the objects as shapes or aspaths.
o ImportInMultipleLayers - determines whether to import the data from each ESRI file into separate layer.
o FeatureCreatedCallback - if you want to perform additional customization on each diagram element
implement the INFeatureCreatedCallback interface and set it to this property.

Users Manual
All classes and interfaces referring to the mapping functionality are placed in the Nevron.Diagram.Gis namespace. Let’stake a closer look at them.
1. NEsriShapefile - represents an ESRI shapefile containing geographical data. Provide the name of the ESRI
shapefile (.shp) to the constructor and then call the Read method. For each shapefile you can specify the name of
the column it will use for naming the diagram elements and the min and max zooming factor it will be shown on.
2. NEsriMap - represents a collection of ESRI shapefiles. You can add one or more files using the Add method. Itreturns a reference to the ESRI shapefile, so that you can set one or more of its properties if you want to. The
Read method is used to read all shapefiles in the map. You can use the indexer to get a reference to theshapefiles. The GetAllFeatures method returns all shapes in all shapefiles of the map. Using the Parallels andMerdians properties you can specify the way they are rendered. The Projection property determines the projectionused to convert the 3D geographical data to 2D map data.
3. NGisFeature - this class is tha base for all ESRI shapes. It contains two important values that are common for all
ESRI shapes - the shape type (the possible shape types are described in the ENShapefileRecordType enum) andthe attributes of the shaped. The attributes are read from the .dbf file that has the same name as the .shp file andare stored as a DataRow object.
4. INFeatureCreatedCallback - interface containing callbacks for shape creation. You should implement thisinterface if you want to be informed each time a diagram element is created and imported from the ESRI shapefile
to the diagram. This makes it easy for you to apply additional styling on the imported diagram elements according
to the attributes of each shape. For example if you want to make the cities that have population more than
5 000 000 two times bigger than the others you should use code similar to:
public void OnPointCreated(NDiagramElement element, NGisFeature feature){
NPointElement pe = (NPointElement)element;
float population = float.Parse(feature.Attributes["POPULATION"].ToString());
if (population > 5000000){pe.Size = new NSizeF(2 * pe.Size.Width, 2 * pe.Size.Height);}}

Visualize Your Successwww.nevron.com

sales@nevron.com

1-888-201-6088

5. NEsriImporter - this class is used to convert ESRI features to diagram elements and import them in your diagram.
As said previously in the How to add a map section the class provides some properties that can help you control
the importing process:o PolygonsAsShapes, PolylinesAsShapes - determine whether to render the objects as shapes or aspaths.
o ImportInMultipleLayers - determines whether to import the data from each ESRI file into separate layer.
o FeatureCreatedCallback - if you want to perform additional customization on each diagram element
implement the INFeatureCreatedCallback interface and set it to this property.
6. NGisProjection - abstract base class for the projections that specify how to interpret the 3D map data as 2D
rendering data. Currently the following projections are available:

Aitoff - Proposed by David A. Aitoff in 1889, it is the equatorial form of the azimuthal
equidistant projection, but stretched into a 2:1 ellipse while halving the longitude fromthe central meridian.

Bonne - a pseudoconical equal-area map projection. All parallels are standard, withthe same scale as the central meridian; parallels are concentric circles. No distortion
along the reference parallel or the central meridian.

Cylindrical Equal-Area - represents a cylindrical equal-area projection of the Earth.
The following is a summary of cylindrical equal-area projection's special cases:o Lambert - standard parallel of 0 degrees
o Behrmann - standard parallel of 30 degrees
o Tristan Edwards - standard parallel of 37.383 degrees
o Peters - standard parallel of 44.138 degrees
o Gall - standard parallel of 45 degrees
o Balthasart - standard parallel of 50 degrees

Equirectangular - projection that maps meridians to equally spaced vertical straightlines, and parallels to equally spaced horizontal straight lines.

Visualize Your Successwww.nevron.com

sales@nevron.com

1-888-201-6088

Eckert IV - pseudocylindrical and equal area projection. The central meridian isstraight, the 180th meridians are semi-circles, other meridians are elliptical. Scale istrue along the parallel at 40:30 North and South.

Eckert VI - pseudocylindrical and equal area projection. The central meridian and allparallels are at right angles, all other meridians are sinusoidal curves. Shape distortion
increases at the poles. Scale is correct at standard parallels of 49:16 North and South.

Hammer - an equal-area map projection, described by Ernst Hammer in 1892. Directly
inspired by the Aitoff projection, Hammer suggested the use of the equatorial form of
the Lambert azimuthal equal-area projection instead of Aitoff's use of the azimuthal
equidistant projection. Visually, the Aitoff and Hammer projections are very similar, butthe Hammer has seen more use because of its equal-area property.

Kavrayskiy VII - a map projection invented by V. V. Kavrayskiy in 1939 for use as a
general purpose pseudocylindrical projection. Like the Robinson projection, it is acompromise intended to produce good quality maps with low distortion overall. Itscores well in that respect compared to other popular projections, such as the Winkel
Tripel, despite straight, evenly-spaced parallels and a simple formulation. It has beenused in the former Soviet Union but is almost unknown in the Western world.
Mercator - introduced in 1569 by Gerardus Mercator. It is often described as acylindrical projection, but it must be derived mathematically. The meridians are equallyspaced, parallel vertical lines, and the parallels of latitude are parallel, horizontal
straight lines, spaced farther and farther apart as their distance from the Equatorincreases. This projection is widely used for navigation charts, because any straightline on a Mercator-projection map is a line of constant true bearing that enables anavigator to plot a straight-line course. It is less practical for world maps because thescale is distorted; areas farther away from the equator appear disproportionately large.
On a Mercator projection, for example, the landmass of Greenland appears to begreater than that of the continent of South America; in actual area, Greenland issmaller than the Arabian Peninsula.

Visualize Your Successwww.nevron.com

sales@nevron.com

1-888-201-6088

Miller Cylindrical - a modified Mercator projection, proposed by Osborn Maitland
Miller (1897-1979) in 1942. The parallels of latitude are scaled by a factor of 0.8,
projected according to Mercator, and then the result is divided by 0.8 to retain scalealong the equator.

Mollweide - The Mollweide projection is a pseudocylindrical map projection generally
used for global maps of the world (or sky). Also known as the Babinet projection,
homolographic projection, or elliptical projection. As its more explicit name Mollweide
equal area projection indicates, it sacrifices fidelity to angle and shape in favor ofaccurate depiction of area. It is used primarily where accurate representation of area
takes precedence over shape, for instance small maps depicting global distributions.

Orthographic - a perspective (or azimuthal) projection, in which the sphere isprojected onto a tangent plane. It depicts a hemisphere of the globe as it appears fromouter space. The shapes and areas are distorted, particularly near the edges, butdistances are preserved along parallels.

Robinson - made in 1988 to show the entire world at once. It was specifically createdin an attempt to find the good compromise to the problem of readily showing the whole
globe as a flat image. The projection is neither equal-area nor conformal, abandoning
both for a compromise. The creator felt this produced a better overall view than could
be achieved by adhering to either. The meridians curve gently, avoiding extremes, butthereby stretch the poles into long lines instead of leaving them as points. Hence
distortion close to the poles is severe but quickly declines to moderate levels moving
away from them. The straight parallels imply severe angular distortion at the highlatitudes toward the outer edges of the map, a fault inherent in any pseudocylindricalprojection.

Stereographic - it is a particular mapping (function) that projects a sphere onto aplane. The fact that no map from the sphere to the plane can accurately represent bothangles (and thus shapes) and areas is the fundamental problem of cartography. Ingeneral, area-preserving map projections are preferred for statistical applications,because they behave well with respect to integration, while angle-preserving(conformal) map projections are preferred for navigation. The stereographic projection
falls into the second category.

Visualize Your Successwww.nevron.com

sales@nevron.com

1-888-201-6088

Van der Grinten - neither equal-area nor conformal projection. It projects the entire
Earth into a circle, though the polar regions are subject to extreme distortion. The
projection offers pleasant balance of shape and scale distortion. Boundary is a circle;
all parallels and meridians are circular arcs (spacing of parallels is arbitrary). No
distortion along the standard parallel at the equator.

Wagner VI - a pseudocylindrical whole Earth map projection. Like the Robinson
projection, it is a compromise projection, not having any special attributes other than apleasing, low distortion appearance.

Winkel Tripel - a modified azimuthal map projection proposed by Oswald Winkel in1921. The projection is the arithmetic mean of the equirectangular projection and theAitoff projection. Goldberg & Gott show that the Winkel Tripel is arguably the best
overall whole-earth map projection known, producing very small distance errors, small
combinations of ellipticity and area errors, and the smallest skewness of any map. In
1998, the Winkel Tripel projection replaced the Robinson projection as the standard
projection for world maps made by the National Geographic Society.

Conclusion
The growing need of applications that provide geographical aware data makes it very important for any developer to have arobust and carefully tested solution that will save his time by simplifying the process of adding geographical and mapping
features to his application. And here’s where Nevron mapping solution comes in handy.

Learn more
For more information on Nevron Diagram for .NET and view the demo examples, download a fully functional evaluation of
the product, visit: http://www.nevron.com.

Visualize Your Successwww.nevron.com

sales@nevron.com

1-888-201-6088