This example demonstrates how to create a point shapefile by placing 1000 points randomly. Here is a screenshot with the results of the code execution.
using System;
using AxMapWinGIS;
using MapWinGIS;
namespace Examples
{
public partial class MapExamples
{
public void CreatePointShapefile(
AxMap axMap1)
{
bool result = sf.CreateNewWithShapeID(
"",
ShpfileType.SHP_POINT);
double xMin = 0.0;
double yMin = 0.0;
double xMax = 1000.0;
double yMax = 1000.0;
for (int i = 0; i < 1000; i++)
{
pnt.x = xMin + (xMax - xMin) * rnd.NextDouble();
pnt.y = yMin + (yMax - yMin) * rnd.NextDouble();
int index = 0;
sf.EditInsertShape(shp, ref i);
}
}
}
}
ShpfileType
The type of the shapefile.
Definition: Enumerations.cs:169
tkDefaultPointSymbol
The set of available point symbols. They represent macros for modification of several properties of t...
Definition: Enumerations.cs:460
tkMapProjection
Commonly used map projections to be set in Form Designer (see AxMap.Projection property).
Definition: Enumerations.cs:1741
Map component for visualization of vector, raster or grid data.
Definition: AxMap.cs:56
A point object represents a point with x, y, Z, and M values. Shapes created by adding point objects ...
Definition: PointClass.cs:38
A shape object represents a geometric shape which can be added to a shapefile which is displayed in t...
Definition: Shape.cs:41
bool Create(ShpfileType shpType)
Creates a new shape of the specified type.
Definition: Shape.cs:154
bool InsertPoint(Point newPoint, ref int pointIndex)
Inserts the specified point object into the shape using the desired point index if possible.
Definition: Shape.cs:372
Provides a functionality for accessing and editing ESRI shapefiles.
Definition: Shapefile.cs:72
tkMapProjection Projection
Sets projection of the map. It providers 2 most commonly used coordinate system/projections to be eas...
Definition: AxMap.cs:2709
int AddLayer(object Object, bool visible)
Adds a layer to the map.
Definition: AxMap.cs:1342