Interop.MapWinGIS
Represents a single chart on the map.
\dot
digraph chart_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
lb [ label="Chart" URL="\ref Chart"];
node [color = tan peripheries = 1 height = 0.3, width = 1.0];
lbs [ label="Charts" URL="\ref Charts"];
edge [ dir = "none", arrowhead="open", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
lbs -> lb [ URL="\ref Charts.get_Chart()", tooltip = "Charts.get_Chart()", headlabel = " n"];
}
\enddot
Graph description\n\n
The number of bars or sectors depends on the number of charts fields specified in the instance of the Charts class it belongs to.
In the same way the visualization options depends in the corresponding settings of the Charts class.
Each chart borrows it's data from attribute table of shapefile (see Table). So the only way to change the height of individual
bars is to modify the values in the underlying .dbf table.\n\n
This class isn't meant for creation of the new charts but only for modification of position and
visibility of the existing ones. Initially charts are generated by using Charts.Generate() method.
Afterwards to access a single chart Charts.get_Chart() property can be used.
\code
// let's assume we need to change the properties of the chart for the 17-th shape of the shapefile
public void ModifyChart(AxMap map, Shapefile sf)
{
int shapeIndex = 16; // shape indices are 0-based
// retrieving chart object
Chart chart = sf.Charts.get_Chart(shapeIndex);
if (chart != null)
{
// is it currently displayed on the screen?
MessageBox.Show("The chart is drawn: " + chart.IsDrawn.ToString());
chart.PositionX += 10.0; // let's move it to the right by 10 map units
chart.PositionY -= 5.0; // let's move it to the bottom by 5 map units
chart.Visible = true; // ensure that it's visible
map.Redraw(); // redraw is needed to see the changes of position
}
else
{
MessageBox.Show(string.Format("The chart with index {0} doesn't exists", shapeIndex));
}
}
\endcode
\new48 Added in version 4.8
Returns a boolean value which indicates whether the chart is currently displayed on the map.
%Chart can be left undrawn because of the following reasons:
- shapefile layer is set invisible;
- dynamic visibility activated for the shapefile layer or charts;
- chart is located outside the current map extents;
- all the charts or this particular chart were set to be invisible;
- it overlaps already drawn charts and Charts.AvoidCollisions is set to true.
Gets or set the horizontal position of chart in map units.
Gets or sets the vertical position of the chart in map units.
Returns the rectangle which the chart occupies on the screen.
This property will return NULL in case Chart.IsDrawn returns false.
Gets or sets the value which indicates whether the chart should be drawn on the map.
Setting this property to true doesn't mean that it actually will be displayed on the map (see Chart.IsDrawn).
Gets or sets the colour of the bar or sector.
Gets or sets the index of field from attribute table (.dbf) to take values from.
Gets or sets the name of the chart field.
In most cases it should be set equal to the name of the .dbf field from which
the data is taken, unless some more comprehensive alias is needed.
Provides functionality for generation and managing the charts on the map.
\dot
digraph charts_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
cht [ label="Chart" URL="\ref Chart"];
cfld [ label="ChartField" URL="\ref ChartField"];
node [color = tan, peripheries = 1, height = 0.3, width = 1.0];
charts [ label="Charts" URL="\ref Charts"];
node [style = dashed, color = gray];
sf [ label="Shapefile" URL="\ref Shapefile"];
edge [ dir = "none", arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
sf -> charts [ URL="\ref Shapefile.Charts", tooltip = "Shapefile.Labels", headlabel = " 1"];
edge [style = solid]
charts -> cht [ URL="\ref Charts.get_Chart()", tooltip = "Labels.get_Chart()", headlabel = " n"];
charts -> cfld [ URL="\ref Charts.get_Field()", tooltip = "Labels.get_Field()", headlabel = " n"];
}
\enddot
Graph description\n\n
The charts obtain their data from the fields of attribute table of the shapefile.
A single bar or sector of the chart is mapped to a certain field by means of ChartField class. The number of fields
to be displayed can be changed by Charts.AddField, Charts.RemoveField. The fields should be of numeric types, either
double or integer.\n\n
Two types of charts are available:
-# Pie charts:
- are suitable when it's necessary to display the parts of the whole phenomenon,
like the percentage of land use by type (urban, forest, agricultural, etc.);
- it's possible to set varying width for the charts depending of the certain field,
which can give an idea about the values for different shapes on comparative scale;\n
.
-# Bar charts:
- they can be used to display virtually any numeric data;
- it still makes sense to display fields with the same units of measure;\n
.
.
\image html charts.png
To generate charts one basically needs:\n
-# To specify a set of fields which will be included (see Charts.AddField and Charts.AddField2). \n\n
-# To define the positions of the charts relative to the parent shape.
- Charts.Generate method is the only one to do this job;
- for large shapefile this procedure can be time consuming, therefore there are means for caching this data to
avoid additional recalculations;
- it's possible to change the generated positions of the individual charts (see Chart.PositionX, Chart.PositionY).\n\n
.
-# To set the display options of the charts. The options include:
- the size of charts (Charts.PieRadius for pie charts and Charts.BarHeight for bar charts; the values of these 2 types of charts don't affect each other);
- the colour of the charts fill and outline;
- labels with the values from the underlying table, which correspond to particular bar or sector.\n
.
.
\code
private void GenerateCharts(Shapefile sf)
{
sf.Charts.AddField2(0, 255); // index of field, colour
sf.Charts.AddField2(1, 255);
sf.Charts.Generate(tkLabelPositioning.lpCentroid);
sf.Charts.ChartType = tkChartType.chtBarChart;
}
\endcode
Individual charts can be accessed using Charts.get_Chart() property. It's possible to change their properties like visibility or position.
Chart.ScreenExtents property return screen coordinates occupied by particular chart which provides a convenient way for
highlighting or mouse dragging operation on the chart.\n
By default charts are drawn for each shape of the shapefile, but if only a subset of shapes require charts
it's possible to set Charts.VisibilityExpression, or toggle the visibility of individual charts (Chart.Visible).
Though the number of individual charts will always be equal to the number of shapes in the shapefile, which
means that charts will be automatically added and removed after corresponding editing operation in the parent shapefile.
It's not possible to set different visualization options or the number of fields for individual charts.\n
It's not possible to use charts independently of the shapefile layer. But it's possible to create
a dummy shapefile, populate it with data and display any charts at any location.
\new48 Added in version 4.8
Adds a field to the chart.
The field will be represented as bar or sector depending on chart type.
A field to add.
True on success or false otherwise.
Adds a field to the chart.
The index of the field in the attribute table to take values from.
The colour of the sector or bar for visualization of a field.
Gets or set a boolean value which indicates whether charts can overlap each other.
Setting this property to true will prevent the drawing of overlapping
charts and hence some charts can be left undrawn. The default value is true.
Gets or sets the maximum height of the bar chart in pixels.
The value set will be used to display the maximum value of the field.
The bar height for smaller values will be proportionally smaller.
Gets or sets the width of a single bar of the chart in pixels.
Gets or sets the text string for description of the chart data.
It can be used for clarification of the map's legend.
Gets or sets the type of the charts.
Bar and pie charts are available. All charts of the shapefile
are of the same type.
Clears the information about individual charts like position and visibility.
To restore the charts a call of Charts.Generate() is needed. The fields
will remain untouched by this method.
Removes all fields which define bars or sectors of the chart.
Gets or sets the minimal distance between individual charts when Charts.AvoidCollisions is set to true.
This allows to arrange charts in more sparse pattern to make them more readable.
Naturally the larger this distance is, the smaller is the number of charts which can be drawn
on screen simultaneously.
Returns the number of charts which is equal to the number of shapes in the parent shapefile.
Restores the state of the charts from the serialized string.
Serialized string generated by Charts.Serialize().
Draws a chart on the specified device context. Can be used for displaying of map legend.
The handle of the device context.
The position of the left corner of the drawing in pixels.
The position of the top corner of the drawing in pixels.
When set to true the labels won't be drawn.
The back colour of the device context.
Should be provided to ensure correct alpha blending when transparency is set.
True on success and false otherwise.
Gets or sets a value which indicates whether charts will be visible for all scales or in the given range of scales only.
\see Charts.MaxVisibleScale, Charts.MinVisibleScale
Generates a chart for every shape of the parent shapefile.
This method is time consuming for large shapefiles, therefore consider the serialization of
charts data after first generation.
The position of chart relative to the parent shape.
True on success and false otherwise.
Gets or sets a callback object to display progress and error information.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Gets the minimal height of the image to display a single chart.
The property can be used for interactive selection of charts and for drawing of legend.
Gets the minimal width of the image to display a single chart.
The property can be used for interactive selection of charts and for drawing of legend.
Inserts a field which represents single bar or sector of the chart.
The index to insert the field at.
The chart field object to insert.
True on success and false otherwise.
Inserts a field which represents single bar or sector of the chart.
The index to insert the field at.
The index of the field from the attribute table (.dbf) to take values from.
The colour of the fill.
True on success and false otherwise.
Gets or sets a string value associated with the object.
Gets the code of the last error which took place inside the current instance of the class.
The use of this property will clear the error until the next error occurs.
Gets or sets the color of the chart outline
Loads charts data from the XML file generated by Charts.SaveToXML.
The filename to load data from.
True on successful loading and false otherwise.
Get or sets the maximum scale the charts are displayed when dynamic visibility is turned on.
Gets or sets the minimal scale the charts are displayed when dynamic visibility is turned on.
Changes the position of a field (bar or sector) in the list which affects the order of drawing.
The old index of the field.
The new index of the field.
Gets or sets the index of field upon which the values of other fields will be divided before displaying charts.
It can be used to display the data in percentage for bar charts. For example, if a chart
displays groups of population for a cities, then normalization field can be the total population of the cities, so that
percentages between different towns can be compared on the same scale.
Gets the number of fields which correspond to the bars of sectors depending on chart type.
Gets or sets the horizontal offset for drawing charts.
Positive values will move charts to the right. This
value affects all the charts. Use Chart.PositionX to move individual charts.
Gets or set the vertical offset for drawing charts.
Positive values will move charts up. This value affects all the charts.
Use Chart.PositionY to move individual charts.
Gets or sets the radius of the pie chart in pixels.
Gets or sets the radius of the largest chart when Charts.UseVariableRadius is turned on.
Gets or set the rotation of the pie chart.
This property is no implemented.
Removes the field which corresponds to the bar or the sector of the chart.
The index of the field to remove.
True on success and false otherwise.
Saves the state of the charts to the XML file.
Charts.SavingMode defines the particular data which will be serialized.
The filename to save into.
True on success and false otherwise.
Gets or sets the mode for serialization of charts. Affects Charts.SaveToXML method.
Returns the indices of charts which are displayed within specified rectangle on the screen.
The rectangle to select charts within (in screen coordinates).
The tolerance in pixels. The bounding box will be expanded by this values.
The selection mode.
The array of integer type with indices of the selected charts.
True if at least one chart was selected and false otherwise.
Serializes the state of the charts to the string.
The serialized string.
Gets or sets the index of field which affect the radius of charts when Charts.UseVariableRadius is set to true.
In most cases this field doesn't included in the chart itself.
Gets or sets the value which affects 3D display of the charts.
This value corresponds to the "height" for pie charts and "depth" for bar charts.
\see Charts.Use3DMode.
Gets or sets the tilt of the charts when 3D display is on.
\see Charts.Use3DMode.
Gets or set the transparency of charts (0-255).
The values range from 0(transparent) to 255(opaque). The data labels aren't affected by this value.
Gets or sets a boolean value which indicates whether 3D mode will be used for charts drawing.
Gets or sets the value which indicates whether all pie charts will have the same or varying radius.
When set to true, the radius of the individual charts will depend upon the value in Charts.SizeField.
Gets or sets the value which indicates whether data labels for charts will be bold.
Gets or sets the colour of the chart's data labels.
Gets or sets the value which indicates whether data labels for charts will be italic.
Gets or sets the font name for data labels of charts. The names of font families like "Arial" can be used.
Gets or set the size of chart's labels.
Gets or sets the colour of the frame for chart labels.
Gets or sets a boolean value which indicates whether the frame of chart's labels is visible.
Gets or sets the style of the chart's labels.
Gets or sets the value which indicates whether labels with values of the fields will be drawn near each chart.
Gets or sets the position of charts in the map drawing order.
Gets or sets the expression which defines the subset of charts which will be displayed on the map.
Turns on or off the visibility of charts.
Gets a reference to the chart with the specified index.
The index of the chart to extract.
The reference to the chart of NULL reference on failure.
Gets the description of the specified error code.
The error code returned by Charts.LastErrorCode.
The description of error.
Gets a reference to the field of the chart with the specified index.
The index of the field.
The reference to the chart field or NULL reference on failure.
Adds a single break to the colour scheme.
The value of the break. Must be within 0.0 to 1.0 range.
The colour of the break.
Clears all the breaks from the colour scheme.
Reverses the order of color breaks in the color scheme.
\new494 Added in version 4.9.4
Gets or set the callback object to report errors.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Gets or sets the string value associated with the instance of the class.
Gets the code of the last error which occurred within this instance of class.
Returns the number of breaks within colour scheme.
Removes colour break with specified index.
The index of colour break to remove.
True on successful removal and false otherwise.
Clears all the existing breaks and creates 2 breaks with the specified colours.
The values of the breaks will be 0.0 for the first one and 1.0 for the second.
The colour of the first break.
The colour of the second break.
Clears all the existing breaks and creates 2 breaks with the specified colours.
The values of the breaks will be 0.0 for the first one and 1.0 for the second.
The colour of the first break.
The colour of the second break.
Clears all the existing breaks and creates 2 breaks with the specified colours.
The values of the breaks will be 0.0 for the first one and 1.0 for the second.
The red component of colour for the first colour break (0-255).
The green component of colour for the first colour break (0-255).
The blue component of colour for the first colour break (0-255).
The red component of colour for the second colour break (0-255).
The green component of colour for the second colour break (0-255).
The blue component of colour for the second colour break (0-255).
Clears all the existing breaks and creates new set of breaks specified by predefined colour scheme.
The number of the newly added breaks depends on the colour scheme chosen, usually 2-3.
Gets the colour of the specific colour break.
The index of the colour break.
The colour of the break.
Gets the value of the specific colour break.
The index of the colour break.
The value of the colour break (0.0-1.0).
Gets the description of the given error code.
Error code returned by ColorScheme.LastErrorCode.
The description of the error.
Calculates the colour which corresponds to the specific value.
In cases when the value isn't equal to the value of the existing break, colour interpolation will be made.
The value to calculate colour for. Must be within [0.0, 1.0] range.
The interpolated colour.
Generates random colour based on the input value.
The calculation will be made as following:
- 2 colour breaks will be defined between which the value lies;
- for each component of the colour a random value will be generated which lies between the value of the same colour component for the 2 adjacent breaks;
- the resulting colour will be calculated as the sum of 3 components.
.
The value to calculate colour for. Must be within [0.0, 1.0] range.
The random colour.
Sets the colour of break with the specified index.
The index of the break.
The new colour to set.
Represents a layer downloading and displaying the data from the particular WMS Server.
\new494 Added in version 4.9.4
Closes the layer.
Serializes the state of the layer.
The string with serialized state.
Restores the state of the layer from the string.
String with the previous state of the layer.
True on success.
Gets the code of the last error which occurred inside this instance.
Gets error message for the specific error code.
The error code.
The error message.
Gets or sets a key associated with this instance (any data can be stored in it by applications).
Gets or sets the name of the layer.
Gets or sets the bounding box of the layer (server coordinate system).
Gets or sets the EPSG code of the coordinate system to be used to request data from the server.
Gets or sets the string with the layers to be requested from server (several comma separated layers are can be specified).
Gets or sets the base URL of the WMS layer.
For example, http://demo.lizardtech.com/lizardtech/iserv/ows. The other parts of the request will
be generated dynamically.
Gets or sets the unique identifier of the layer. It is used to cache the data locally.
Gets or sets the format parameter of the request.
Gets a value indicating whether this instance is initialized (bound to particular server).
Gets the bounding box for the layer in map coordinates.
Gets the projection of the layer.
Gets or sets the opacity of the layer which is used during rendering.
Gets or sets the brightness of layer (color adjustment to be used during rendering).
Gets or sets the contrast of layer (color adjustment to be used during rendering).
Gets or sets the contrast of layer (color adjustment to be used during rendering).
Gets or sets the hue of layer (color adjustment to be used during rendering).
Gets or sets the gamma of layer (color adjustment to be used during rendering).
Gets or sets a value indicating whether data from the local cache will be used.
Gets or sets a value indicating whether the data will be cached locally.
Gets or sets the color which be treated as transparent during rendering.
Gets or sets a value indicating whether transparent color should be used.
Gets or sets the version parameter which will be included in the request.
Gets or sets the styles parameter which will be included in the request.
Holds list of shapes and pixels which where identified by user with Identify tool.
\new494 Added in version 4.9.4
Adds the shape from the specified layer to the list.
The layer handle.
Index of the shape.
Clears all the shapes and pixels from the list.
Removes all items from the list which belong to specified layer.
The layer handle.
Adds a pixel to the list.
Updated in v4.9.5
The layer handle.
The column.
The row.
Toggles the state of the specified pixel (add it to the list if it is not present there, and removes otherwise).
Updated in v4.9.5
The layer handle.
The column.
The row.
Gets the count.
Gets the layer handle for the item with specified pixel.
The index of the item (either shape or pixels).
The layer handle.
Gets the index of the shape for the specified item.
The index of the item.
The index of the shape or -1, if this item is a pixel.
Gets the type of the layer for the specified pixel.
The index of the item.
The type of the layer.
Gets X coordinate pixel.
The index of the item.
X coordinate or -1 if the specified item is a shape.
Gets Y coordinate pixel.
The index of the item.
Y coordinate or -1 if the specified item is a shape.
Gets the row.
The index of the item.
Row index or -1 if the specified item is a shape.
\new495 Added in version 4.9.5
Gets the column.
The index of the item.
Column index or -1 if the specified item is a shape.
\new495 Added in version 4.9.5
Represents a single band of raster datasource.
Please refer to GDAL documentation for more details information.
\new494 Added in version 4.9.4
Gets unique values of the band.
The maximum count of values to be returned.
The array with values.
True on success.
Gets the default histogram.
If set to true and there is no dialog available, it will be calculated.
The histogram.
Gets custom histogram for the raster band.
The minimum value.
The maximum value.
The number buckets.
If set to true the values outside the specified range will be included in outer buckets.
If set to true the approximate calculation will be allowed.
Gets statistics for the raster band.
If set to true the approximate calculation will be allowed.
if set to true the calculation will be performed even if there are no cached values.
The minimum value.
The maximum value.
The mean.
The standard deviation.
True on success.
Builds classification for the raster band.
The minimum value.
The maximum value.
The classification type.
The number of categories.
Resulting classification.
Computes the minimum and maximum value for the raster band.
If set to true the approximate calculation will be allowed.
The minimum value.
The maximum value.
True on success.
Computes local statistics for the data in the vicinity of particular pixel.
The column.
The row.
Number of pixel on each side to be included in calculation.
The minimum value.
The maximum value.
The mean.
The standard deviation.
The count.
True on success.
Gets no data value.
Gets the minimum.
Gets the maximum.
Gets the number of overviews for the raster band.
Gets or sets the color interpretation for the raster band.
Gets the data type of the raster band.
Gets the width of the raster band in pixels.
Gets the height of the raster band in pixels.
Gets the size of horizontal block for the raster (in pixels).
Gets the size of vertical block for the raster (in pixels).
Gets the type of the unit.
Gets the raster value scale (is used for coordinate transformation).
Gets the raster value offset (is used for coordinate transformation).
Gets a value indicating whether the raster band has color table.
Gets the number of metadata items associated with the band.
Gets the specified metadata item.
Index of the item.
String with metadata.
Gets the color table associated with the band.
Gets specified overview of the raster band.
Index of the overview.
The overview as another instance of GdalRasterBand.
Gets the value of the specified pixel.
The column.
The row.
The value.
True on success.
Holds all available GDAL drivers.
\new494 Added in version 4.9.4
Gets the number of drivers.
Gets the specified driver.
Index of the driver.
The driver.
Gets driver with the specified name.
Name of the driver.
The driver.
Represents a single GDAL driver.
Please refer to GDAL documentation for more details information.
\new494 Added in version 4.9.4
Gets particular metadata associated with the driver.
The metadata.
String with metadata.
Gets the the number of metadata items associated with the driver.
Gets specified metadata item.
Index of the metadata item.
String with metadata.
Gets the name of the driver.
Gets a value indicating whether the driver works vector data.
Gets a value indicating whether the driver works raster data.
Gets the type of the specified metadata item.
Index of the metadata item.
Type of the metadata item.
Gets the value of the specified metadata item.
Index of the metadata.
String with metadata.
Gets the key of the specified metadata item.
Index of the metadata item.
Metadata item key.
Represents a light wrapper around GDAL raster dataset which allows to perform some
operations without using more advanced classes like RasterSource or GridSource.
\new494 Added in version 4.9.4
Opens datasource from the specified filename.
The filename.
If set to true the datasource will be opened in read only mode.
True on success.
Closes the datasource.
Sets transformation parameters for GDAL datasource.
The x coordinate of the top left pixel.
The width of a pixel.
The projection of Y on X axis.
The y coordinate of the top left pixel.
The projection of X on Y axis.
The height of a pixel.
Sets projection of the datasource
The projection.
True on success.
Gets the driver which manages this datasource.
Represents a function supported by built-in expression parser.
\new494 Added in version 4.9.4
Gets the name of the function.
Gets the alias of the function.
Index of the alias.
Gets the number of aliases that the function has.
Gets the number of parameters of the function.
Gets the group to which this function belongs.
Gets the description of the function.
Gets the name of the specified parameter.
Index of the parameter.
The name of the parameter.
Gets the description of the specified parameter of the function.
Index of the parameter.
The description of the parameter.
Gets the signature of the function.
Represents expression parser and evaluator.
\new494 Added in version 4.9.4
Parses the specifies string and build an expression out of it.
The string with expression.
True on success.
Calculates the expression.
The result.
Result which is of string, double, or boolean type.
Parses expression seeking for fields in the specified table.
The expression to parse.
The table.
True on success.
Calculates the expression for the given table row and writes the result to the specified field.
Index of the row.
Index of the target field.
True on success.
Calculates the expression for the given table row.
Index of the row.
The result of calculation (string, double, or boolean).
True on success.
Gets the last error message.
Gets the position of the last error.
Gets the number of functions recognized by the expression parser.
Gets the specified function from the list of function recognized by the expression parser.
Index of the function.
The function object with metadata.
Gets the table associated with the current expression.
Represents a rectangle that can be rendered on the map.
\new494 Added in version 4.9.4
The X coordinate of the top-left corner of the rectangle.
The Y coordinate of the top-left corner of the rectangle.
The width of the rectangle.
The height of the rectangle.
Gets or sets a value indicating whether rectangle is visible.
Type of coordinates which are used to specify the position and size of the rectangle.
Gets or sets the opacity of the rectangle.
Gets or sets the color of the rectangle.
Gets or sets the width of the rectangle's border.
An ESRI grid manager object provides functions which facilitate using ESRI grids with MapWinGIS.
The functions and properties are listed below. Clicking on each will yield a description of
the function and its arguments as well as sample code where applicable.
Gets whether or not MapWinGIS can open ESRI grids.
Since ESRI grids are proprietary, MapWinGIS can only open them if another ESRI product has already been installed
which provides the files needed to manipulate ESRI grids.
A boolean value representing whether or not MapWinGIS can open ESRI grids.
Deletes the specified ESRI grid.
The filename of the ESRI grid to be deleted.
A boolean value representing the success or failure of deleting the specified ESRI grid.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Gets whether or not the specified file is an ESRI grid.
The filename of the grid to be checked.
A boolean value representing whether or not the specified file is an ESRI grid.
Retrieves the last error generated in the object.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Represents a rectangle on the map.
In some cases additional Z and M dimensions can also be specified to denote the altitude of the displayed data for example.\n
Let's see how to display certain extents on the map.
\code
double y = 48.7; // latitude, deg.
double x = 2.3; // longitude, deg.
double span = 0.1; // deg.
// extents from 48.5 to 48.9 degrees of north latitude and
// from 2.1 to 2.5 degrees of east longitude will be set
Extents ext = new Extents();
ext.SetBounds(x - span, y - span, 0.0, x + span, y + span, 0.0);
// show them on the map
AxMap axMap;
if (axMap.MapUnits == tkUnitsOfMeasure.umDecimalDegrees){
axMap.Extents = ext;
}
\endcode
MapWinGIS doesn't hold instances of %Extents class for layers or map, but generates them on each client call.
Therefore it's useless to try to change those extents in the way like this:
\code
AxMap axMap;
Extents ext = axMap.Extents;
ext.SetBounds(some_bounds); // map won't be updated
\endcode
The following line is needed:
\code axMap.Extents = ext; \endcode
In case of data layers, like shapefiles or images, the extents are obtained by calculation,
so the only way to alter them is to change the underlying data.
Gets the bounds of the extents object.
Returns the minimum x value for the extents object.
Returns the minimum y value for the extents object.
Returns the minimum z value for the extents object.
Returns the maximum x value for the extents object.
Returns the maximum y value for the extents object.
Returns the maximum z value for the extents object.
Gets the minimum and maximum measure bounds for the extents object.
Measure bounds only apply to shapefiles containing measure data.
Sets the bounds for the extents object.
The new minimum x value for the bounds of the extents object.
The new minimum y value for the bounds of the extents object.
The new minimum z value for the bounds of the extents object.
The new maximum x value for the bounds of the extents object.
The new maximum y value for the bounds of the extents object.
The new maximum z value for the bounds of the extents object.
Sets the measure bounds of the extents object.
Measure bounds only apply to shapefiles containing measure data.
The new minimum measure bound for the extents object.
The new maximum measure bound for the extents object.
The maximum measure bound in the exents object. Measure bounds only apply to shapefiles containing measure data.
Gets the minimum measure bound for the extents object. Measure bounds only apply to shapefiles containing measure data.
The maximum x bound for the extents object.
Gets the minimum x bound for the extents object.
The maximum y bound for the extents object.
Gets the minimum y bound for the extents object
The maximum z bound for the extents object.
Gets the minimum z bound for the extents object.
Gets serialized contents of the extents for debug purposes.
Serialized string.
\new491 Added in version 4.9.1
Gets a center point for the extents.
\new491 Added in version 4.9.1
Moves extents so that center point will be at specified coordinates, while width and height will be preserved.
X coordinate of new center.
Y coordinate of new center.
\new491 Added in version 4.9.1
Checks whether a point is within extents
X coordinate of point
Y coordinate of point
True if point is within extents
\new491 Added in version 4.9.1
Creates a rectangular polygon matching current extents.
New polygon shape.
\new491 Added in version 4.9.1
Gets the Width of the extents object (xMax - xMin).
Gets the Height of the extents object (yMax - yMin).
Gets the Depth of the extents object (zMax - zMin).
Provides settings for built-in identifier tool (cmIdentify cursor).
\new493 Added in version 4.9.3
Gets or set a value indicating whether shapes of identifiable shapefiles will be highlighted when
mouse pointer is over them.
Gets or sets which layers an identifier will be working with.
Gets or sets outline color for identified shape.
Gets or sets the handle of active layer, which is used when Identifer.IdentifierMode set to imSingleLayer.
Closes current layer and releases resources associated with it.
It's recommended to call this method as soon as the layer is no longer needed.
Returns connection string which was used to open this layer.
\attention Password in connection string is stored as plain text.
Consider measures to ensure its security.
Restores the state of layer from string generated with OgrLayer.Serialize method.
Deserialization includes:\n
a) reconnection to the datasource;\n
b) grabbing data from it;\n
c) restoring of visualization options set for underlying shapefile.\n\n
Particular set of actions depends on the state of the object before serialization.\n
Any data currently stored in this instance will be discarded.
String generated with OgrLayer.Serialize method.
True on success.
Gets GeoProjection associated with current layer.
Corresponds to SRID set for the layer in underlying datasource.
When SRID isn't specified (i.e. equals 0), empty GeoProjection instance will be returned.
Gets the name of geometry column which was used to fetch geometry for current layer.
Depending on data format, a layer may support several geometry columns but
only one will be used to provide shape data via OgrLayer.GetBuffer(). By default
the first column with geometry/geography type will be used. To access other columns
temporary layers can be opened via OgrDatasource.RunQuery.
Gets layer data represented as in-memory shapefile.
Implements lazy loading pattern, i.e. data will be grabbed from underlying datasource
on the first call and will be used for all subsequent calls. To force re-read of the
data from datasource use OgrLayer.ReloadFromSource.\n
This method will automatically be called after adding the layer to the map via
AxMap.AddLayer or AxMap.AddLayerFromDatabase.
Instance of shapefile with layer data or null on failure or for uninitialized layer.
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Gets code of the last error which took place inside this object.
Gets or sets a Callback object which handles progress and error messages.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
A text string associated with object. Any value can be stored by developer in this property.
Gets name of the layer.
The name may correspond to table name in underlying database or store some generic string like
"sql_statement" for temporary layers opened by OgrDatasource.RunQuery.
Opens layer with specified name from the OGR datasource.
This method is called internally by OgrDatasource.GetLayerByName.
Connection string or filename.
Layer name.
Indicates whether the returned layer will support saving of changes back to source
(the functionality should be supported by particular driver).
True on success.
Runs SQL query against datasource and returns results as a temporary layer.
This method is called internally by OgrDatasource.RunQuery.
Connection string or filename.
SQL query.
True on success.
Opens OGR layer from specified file. If the datasource holds several layers only the first one will be opened.
Filename of the datasource to open.
Indicates whether the returned layer will support saving of changes back to source
(the functionality should be supported by particular driver).
True on success.
Runs a new query against the datasource.
The layer must be opened with OgrLayer.OpenFromQuery or OgrDatasource.RunQuery
(OgrLayer.SourceType = ogrQuery) in order for this method to work.
New SQL command.
True on success.
Discards all the local changes and reloads layer from the source.
True on success.
Serializes the state of layer to a string, which can be later restored with OgrLayer.Deserialize.
State information includes connection string, layer name (or query string)
and visualization options for underlying shapefile
(in case it is already populated when the method was called.)
\attention Serialized string holds connection password as a plain text.
Consider measures to ensure its security.
String with state information.
Gets shape type of the current layer.
The property automatically maps underlying OGRwkbGeometryType to corresponding shape type.
Gets "flattened" type of the current layer, i.e. Z and M components will be ignored.
Gets name of the driver which is used to access layer datasource.
Gets the array of available shape types inside OGR layer (should be cast to ShpfileType[]).
\new494 Added in version 4.9.4
Gets or sets the type of the active shape type for the layer (is used in OgrLayer.GetBuffer for example).
\new494 Added in version 4.9.4
Gets layer name or SQL query which was used to open this layer.
Test whether current layer supports certain functionality.
In most cases no actual attempts to perform requested operation is made.
A capability to test.
True in case the capability is supported by the layer.
The following code opens a layer from datasource and display which capabilities are supported for it.
\code
var layer = new OgrLayer();
if (!layer.OpenFromDatabase(CONNECTION_STRING, "waterways", true))
{
Debug.Print("Failed to open layer: " + layer.get_ErrorMsg(layer.LastErrorCode));
}
else
{
var values = Enum.GetValues(typeof(MapWinGIS.tkOgrLayerCapability));
foreach (tkOgrLayerCapability value in values)
{
Debug.Print(value.ToString() + ": " + layer.TestCapability(value).ToString());
}
}
\endcode
Gets extents of the layer.
Depending on driver implementation this method may retrieve this information
directly from underlying datasource without loading the data, which provides
performance benefits.
Retrieved extents.
True to instruct driver to load the data locally
if information can't be retrieved from underlying datasource otherwise.
True on success.
Returns number of features in the layer.
Depending on driver implementation this method may retrieve this information
directly from underlying datasource without loading the data, which provides
performance benefits.
True to instruct driver to load the data locally
if information can't be retrieved from underlying datasource otherwise.
Number of features in the layer.
Gets source type of the layer.
Any new instance of class starts with ogrUninitialized. Successful call of OgrLayer.OpenFromDatabase
method will set it to ogrDbTable, OgrLayer.OpenFromQuery - to ogrQuery.
Source type.
Extracts the last error message reported by GDAL library.
Clears all the styles stored for current layer in datasource.
True on success.
Gets or sets a value indicating whether features for large layers are to be loaded dynamically
when moving to the new portions of map.
When set to false only the number of features set by OgrLayer.MaxFeatureCount
is loaded into memory. No further attempts to load additional features will be done.\n
In dynamic loading mode after map extents change a check is made
whether features for the requested extents are already in memory. If not the data loading
is started in the background thread. When the loading is over all the features currently stored
in memory will be discarded. If the amount of features in new map extents exceeds
OgrLayer.MaxFeatureCount no background loading will be done. \n
The mode is chosen automatically when the layer is opened depending on the number of features.
But afterwards it's possible possible to change the value.
Generates visualization categories for OGR layer.
%Field name to use as a base for classification.
Type of classification.
Number of classes (is not used with unique values classification type).
Starting color for the color scheme.
End color for the color scheme.
Type of color scheme.
True on success.
The whole set of features will be used during classification, not only those currently loaded into memory.
Therefore the method has definite advantage over calling OgrLayer.GetBuffer.Categories.Generate
directly for large layers.\n\n
Categories will be added to underlying shapefile (OgrLayer.GetBuffer). This method
will trigger the population of this shapefile if it's not yet in memory. \n
The following code opens "buildings" layer, generates categories based on "population"
field and then saves them as a "new_style" to the datasource.\n
\code
var layer = new OgrLayer();
if (!layer.OpenFromDatabase(CONNECTION_STRING, "buildings"))
{
Debug.WriteLine("Failed to open the layer: " + layer.GdalLastErrorMsg);
}
else
{
layer.LabelExpression = "[Name]";
layer.LabelPosition = tkLabelPositioning.lpCenter;
layer.GlobalCallback = this;
if (!layer.GenerateCategories("population", tkClassificationType.ctEqualIntervals,
10, tkMapColor.Blue, tkMapColor.Yellow, tkColorSchemeType.ctSchemeGraduated))
{
Debug.WriteLine("Failed to generated categories: " + layer.get_ErrorMsg(layer.LastErrorCode));
}
else
{
var sf = layer.GetBuffer();
Debug.WriteLine("Number of generated categories: " + sf.Categories.Count);
// save it as a new style
if (!layer.SaveStyle("new_style"))
{
Debug.WriteLine("Failed to save style: " + layer.GdalLastErrorMsg);
}
else
{
Debug.WriteLine("The new style has been saved.");
}
}
layer.Close();
}
\endcode
Gets number of styles stored for the layer in datasource.
MapWinGIS provides its own functionality to store visualization styles for OGR layers. Each
style hold serialized state of underlying shapefile and is stored in mw_styles table of database.
The table will be created on the first call of OgrLayer.SaveStyle or on the first call of
OgrDatasource.ImportShapefile when GlobalSettings.UseOgrStyles is set to true. \n
The default style has empty string name (""). When GlobalSettings.UseOgrStyles
is set to true, this style will be automatically created during shapefile import and
then will be applied for the layer on further loadings. Alternative styles can be saved
and applied with OgrLayer.SaveStyle and OgrLayer.ApplyStyle respectively. \n
The style table has following definition for PostGIS datasource:
\code
CREATE Table mw_styles (
StyleId serial primary key,
LayerName varchar(128),
StyleName varchar(128),
Style text,
CONSTRAINT layer_style_unique UNIQUE (LayerName,StyleName)
);
\endcode
Number of styles.
Gets or sets an expression for label generation for the layer.
The syntax of expression is the same as for Shapefile.Labels.Generate method. To
generate labels based on single field use "[FieldName]" syntax. The property is supported
for dynamic loading mode, where labels will be generated on the fly after each zooming
operation.
Gets or sets label orientation for polyline layers.
\see OgrLayer.LabelExpression
Gets or sets position of labels relative to their parent features.
\see OgrLayer.LabelExpression
Gets or sets maximum number of features to be loaded in the memory.
If total number of features exceeds this number the layer will be rendered
in dynamic loading mode (see OgrLayer.DynamicLoading). During dynamic loading if
number of features for the new map extents exceeds this number they won't be loaded. The default
value of property can be changed with GlobalSettings.OgrLayerMaxFeatureCount.
\see OgrLayer.GetBuffer
Removes style with particular name from the datasource.
The name of the style.
True on success.
Checks whether the layers supports saving of styles to the datasource.
This property will check the presence of mw_styles table in the datasource and then
will try to create one if it's missing. If neither succeeds, false will be returned.
Gets name of the style with particular index.
Index of style.
Name of the style.
Gets a specified error message from the log registered during OgrLayer.SaveChanges call.
Index of error.
Error message or empty string on invalid index.
Gets shape index associated with specified error message
from the log registered during OgrLayer.SaveChanges call.
Error index.
Index of shape in underlying in-memory shapefile (OgrLayer.GetBuffer()).
Gets the number of errors registered in the log during OgrLayer.SaveChanges call.
Gets name of feature ID column.
Feature ID column corresponds to primary key in underlying database table.
It is used to uniquely identify features and to save changes back to datasource.
Feature ID column (if present) will always be inserted as a first field of attribute
table of underlying shapefile. This field must not be edited.\n
For inserted features the column values are set to NULL. \n
In case underlying datasource doesn't have feature ID column, an empty string will be returned.
Gets a value indicating whether underlying data ( OgrLayer.GetBuffer ) was reprojected.
This may happen because of projection mismatch on adding it to the map. See GlobalSettings.ReprojectLayersOnAdding for details.
Saves local changes to the datasource.
To check whether the operation is supported for current layer use OgrLayer.get_SupportsEditing.\n
The method works like this:\n
1) Underlying shapefile is analyzed for changes, i.e. for shapes with Shapefile.get_ShapeModified property set to true. \n
2) For each of such shapes UPDATE statement is generated by driver.
Shapes are identified in source by the value of Feature ID column.\n
3) If update operation for particular shape fails the error is registered in:
OgrLayer.get_UpdateSourceErrorMsg().\n
The operation may fail for a particular shape because of 2 main reasons:
- shape is invalid, while validateShapes parameter set to true;
- new values aren't accepted by datasource, which often can maintain stricter data constraints.
Returns number of saved changed.
Sets which part of data should be saved, geometry, attributes or both.
Default value is tkOgrSaveType.ostSaveAll (i.e. both geometry and attributes).
Sets whether shapes will be validated before saving. Default value is true,
i.e. invalid shapes won't be saved.
Result of the operation.
Facilitates interactive creation and editing of vector shapes.
A. General:
Editor work with layers which have their Shapefile.InteractiveEditing property set to true.
This may be both regular shapefile layers and OGR layers (shapefile buffer is accessible via OgrLayer.GetBuffer property for them).\n
In case of OGR layers some other preconditions must also be met to ensure that the changes can be saved back to datasource (see
OgrLayer.get_SupportsEditing) even if the interactive editing itself is working.
Each AxMap control has a single instance of shape editor associated with it available by AxMap.ShapeEditor property. \n
To start editing operation it's enough to set appropriate tool to AxMap.CursorMode property. The following editing tools are
currently available:
- cmAddShape,
- cmEditShape,
- cmMoveShapes,
- cmRotateShapes,
- cmSplitByPolyline,
- cmSplitByPolygon,
- cmEraseByPolygon,
- cmClipByPolygon.
B. Internal data storage.
Editor can store points and parts of only a single shape at a time. It supports all major shape types: points, multipoints,
polylines, polygons. Points entered by user with mouse are stored in internal buffer which can be accessed with
ShapeEditor.RawData property. \n
The data can be validated with ShapeEditor.ValidatedShape. All built-in tools perform validation before saving a new shape to the layer.
If validation fails AxMap.ShapeValidationFailed event will be fired to notify the user.
Invalid data can be be discarded by pressing Esc button or by calling ShapeEditor.Clear.\n
This validation behavior will also prevent changing the active tool (AxMap.CursorMode) while the editing operation is in progress.
The rendering of the point data is carried out independently of the layer. Visualization options can be changed by ShapeEditor.FillColor,
ShapeEditor.LineColor, ShapeEditor.FillTransparency. When editing of a new shape starts this properties
will automatically be set with the values from the parent layer, so the shape being edited will look similar to its layer.
To force redraw of the editor programatically it's enough to call AxMap.Redraw2 with RedrawDynamicTools parameter.
C. Creation of new shapes.
- activated by settings AxMap.CursorMode = cmAddShape;
- only creation of single part shapes supported;
- layer to add the shape to is determined after the first mouse click by handling AxMap.ChooseLayer event;
- new points can be added by left mouse button;
- previous points can be removed by Ctrl+Z shortcut;
- newly entered points by default are snapped to the vertices of exiting shapes (see ShapeEditor.SnapBehavior);
- to finish the creation of shape Ctrl + left mouse click is used;
- if the data passes validation, a new shape will automatically be inserted to the specified layer;
D. Editing of vertices and parts.
The data from existing shapes during the editing is copied to the editor while the original shape
is hidden by setting Shapefile.set_ShapeIsHidden to true. After editing is finished and data in ShapeEditor is successfully validated
original shape is substituted with this new data. If the changes are discarded then Shapefile.set_ShapeIsHidden
property of the original shape is simply set to false.
Editing mode can be activated by settings AxMap.CursorMode = cmEditShape. Clicking on a shape from any layer with interactive
editing enabled will start editing session for this shape. After clicking on blank spot of the map without shapes
an attempt to validate the shape and save the changes will be made. Vertices of shapes available for editing are highlighted
under mouse cursor (ShapeEditor.HighlightVertices).
cmEditShape cursor supports 2 behaviors which can be set by ShapeEditor.EditorBehavior property:
- vertex editor - adding, moving, deleting of vertices; moving a shape as a whole;
- part editor - moving and deleting of separate shape parts.
To add new parts to the shape or create holes in polygon, ShapeEditor.StartOverlay method can be used.
It allows user to digitize a new polygon which afterwards will be overlayed with original shape in
either union (eoAddPart) or difference mode (eoRemovePart).
E. Polyline and polygon overlays:
Overlays a single vector layer with custom digitized polygon or polyline. Currently the following tools of this type are available:
- cmSplitByPolyline - splits polylines or polygons into multiple shapes;
- cmSplitByPolygon - can be used to create a whole in polygon and a separate polygon shape to fill this hole;
- cmEraseByPolygon - shapes and parts of shapes that intersect with the polygon will be removed from the layer;
- cmClipByPolygon - only parts of shapes that intersect the polygon will remain, all other shapes will be removed.
At first the tools work like cmAddShape tool, i.e. allow to digitize either polyline or polygon. After it's finished
(Ctrl + left mouse button) and the newly digitized shape is checked for validity, AxMap.ChooseLayer event will be fired.
If the layer handle provided by user in this event represents vector layer in interactive editing mode, then the requested
operation will be performed on this layer.
F. Group operations.
These operations work on a number of selected shapes within a single layer. The layer can be selected by handing AxMap.ChooseLayer event.
Currently there are 2 built-in tools available:
- cmRotateShapes - can rotate selected shapes around the centre of the bounding box;
- cmMoveShapes - can move selected shapes.
Technically group operations aren't related to the ShapeEditor class, however they are mentioned here to cover all the available tools.
G. Undo list.
All the operations performed by user are registered in so called Undo list (AxMap.UndoList). User can revert them (Ctrl+Z
or UndoList.Undo) or apply once again (Ctrl+Shift+Z or UndoList.Redo).
When interactive editing session is taking place no other editing must be done programatically without registering
in the Undo list. Otherwise Undo list will become invalid.\n
\note The fully working implementation of the shape editor can be examined in the the Demo application
included in MapWinGIS installation (starting from v4.9.3). The source code for this application is available in
the repository.
\new493 Added in version 4.9.3
Calculates the area of polygon being edited.
Precise calculations on ellipsoid will be used if map projection is set and compatible
with WGS84. Otherwise simply Euclidean geometry will be used.
Gets or sets type of the bearing to be display for line segments.
\new493 Added in version 4.9.3
Gets or sets area display mode for polygon shapes. The default value is admNone.
Clears the editor returning it to an empty state.
The method will discard any changes made to the shape being edited.
Applies visualization options defined by ShapeDrawingOptions instance.
This method can be used to make the editor look consistent
with the way subject shape looks in regular mode.
Instance of visualization options.
\see Shapefile.DefaultDrawingOptions
Gets or sets editor behavior during the editing of existing shape, either vertex editor or part editor.
Gets the state an editor is currently in. See tkEditorState enumeration for details.
Gets or sets fill color for the shape being edited. Applies for polygon shapes only.
Gets or sets fill transparency for the shape being edited. Applies for polygon shapes only.
Gets or sets a Callback object which handles progress and error messages.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Returns true if editor has changes caused by user input.
Gets a value indicating whether calculations are performed taking into account the shape of Earth
(when map projection is defined), or on 2D plane (Euclidean geometry).
Gets the length of measured path (in meters if WGS84 compatible projection is set for map and in current map units otherwise).
Gets or sets a value indicating whether area will be displayed during creation or editing of polygons.
Gets or sets the number of decimal degrees to be used to display area.
\new493 Added in version 4.9.3
Gets or sets the number of decimal degrees to be used to display length.
\new493 Added in version 4.9.3
Gets or sets angle format to be used to display bearing.
\new493 Added in version 4.9.3
Gets or sets the number of decimal degrees to be used to display bearing.
This setting is not used when AngleFormat is set to minutes or seconds.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether bearing of the line segments will be displayed.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether length of the line segments will be displayed.
\new493 Added in version 4.9.3
Gets or sets value indicating whether vertices of shapes will be highlighted
on mouse move when interactive editing tools are used.
Gets a value indicating whether a new shape is currently being created.
The property will return true is ShapeEditor is either in
esDigitize, esDigitizeUnbound or esOverlay states.
\see ShapeEditor.EditorState
Returns true if the editor is empty.
Empty means that its underlying shape object has no points. However
ShapeEditor.EditorState can be different from esNone.
A text string associated with object. Any value can be stored by developer in this property.
Gets the code of last error which took place inside this object.
Gets layer handle of shape currently being edited.
This property will be set automatically by ShapeEditor.StartEdit method,
and reverted back to -1 value by ShapeEditor.Clear or ShapeEditor.SaveChanges methods.
Gets or sets length display mode.
Gets or sets line color for the shape being edited.
Gets or sets line width for the shape being edited.
Gets or sets a value indicating whether the indices of shape's vertices are visible.
Gets underlying shape data without any attempt to validate it.
Saves any changes made by user.
The editor will try to validate underlying shape on this call. If validation succeeds
the changes will be passed to the original shapefile or other actions defined by
current interactive tool will be triggered.
Depending on editor state the actions will be:
- esDigitize: new shape will be added to the shapefile set by ShapeEditor.LayerHandle property;
- esEdit: shapefile will be updated with modified version of shape;
- esDigitizeUnbound: a tool which started the unbound mode execute the appropriate action
(clipping, selection by polygon, etc.);
- esOverlay: current overlay operation (i.e. eoAddPart or eoRemovePart) will be discarded, editor
will return in esEdit state after which an attempt will be made to validate and save shape in regular manner.
True on success.
\see AxMap.CursorMode, ShapeEditor.EditorState
Saves the state of the class to the string
A string with the state or an empty string on failure.
Restores the state of object from the string.
A string generated by ShapeEditor.Serialize() method
True on success.
Gets or sets the index of currently selected vertex.
Gets index of the shape being edited.
This property will be set automatically by ShapeEditor.StartEdit method,
and reverted back to -1 value by ShapeEditor.Clear or ShapeEditor.SaveChanges methods.
Gets shape type of the shape currently being edited.
Gets or sets snapping behavior for Shape Editor (snaps vertices to the vertices of
exiting shapes on other layers).
Gets or sets snapping tolerance in screen coordinates.
Starts editing of a given shape in specified shapefile.
Layer handle of the shapefile.
Index of shape to edit.
True on success.
The method will populate the editor with vertices of specified shape,
hide original shape with Shapefile.put_ShapeIsHidden and set ShapeEditor.EditorState to esEdit.
Starts overlay operation for the current shape.
Editor must be in esEdit state already, i.e. ShapeEditor.StartEdit must be called first.
Type of overlay operation.
True on success.
Initializes editor for creation of unbound shape.
Unbound shape is the one which is not linked to particular shapefile. This
method is used internally by a number of built-in tools,
like cmSelectByPolygon or cmSplitByPolyline.
Type of shape to be created.
True on success.
Allows to undo the last vertex entered by user.
The method works when new shape is being created, i.e. ShapeEditor.IsDigitizing return true.
True on success, false if the editor is empty and there is no points to undo.
Validates the data stored by editor and returns it as a shape.
Gets or sets validation mode for the editor.
See tkEditorValidation enumeration for details.
Gets or sets value indicating whether vertices edited shapes are visible.
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Gets coordinates of specified point of edited shape.
Index of point.
X in projected map coordinates.
Y in projected map coordinates.
True if index of point within bounds.
Sets coordinates of specified point of edited shape.
Index of point.
X in projected map coordinates.
Y in projected map coordinates.
True if index of point within bounds.
Returns directional angle (bearing) of a given segment of edited shape.
Segment index to calculate angle for.
Angle in degrees.
Gets length of a given segment of edited shape.
Segment index to calculate length for.
Length of segment in meters.
If map projection is set and compatible with WGS84 geodesic distance will be returned.
Otherwise Euclidean geometry will be used.
Gets number of points the shape being edited has.
Provides information about validation of a single shapefile before or after certain operation.
\new491 Added in version 4.9.1
Gets name of the class geoprocessing method was an from.
Gets number of errors that were fixed, i.e. invalid shapes were substituted with fixed ones.
Get a value indicating whether the input or output was finally considered valid (probably after fixing invalid shapes).
Gets the name of geoprocessing methods that was validated.
Gets the name of parameter of geoprocessing methods that was validated.
Only parameters of Shapefile type are validated. "this" will be returned
in case shapefile object itself from which the method was ran was validated.
Gets number of invalid shapes that were skipped during validation (i.e. input shapes not processed at all
or output shapes excluded from output).
Gets status of validation operation.
Gets number of shape that were still invalid after possible attempts to fix them.
Gets validation mode that was used.
The mode can be changed in GlobalSettings.ShapeInputValidationMode and
GlobalSettings.ShapeOutputValidationMode
Gets a value indicating whether it was input or output validation.
Gets a value indicating whether validation was performed .
I.e. whether ValidationMode was set to something other than NoValidation.
Gets number of shapes that were initially invalid. Depending on validation mode they might be fixed.
Adds statistic operation for a specified field.
Field index in input shapefile.
Operation to calculate.
Adds statistic operation for a specified field.
Name of field in input shapefile (case-insensitive)
Operation to calculate.
Clears all previously added operations
Gets the number of added operations.
A text string associated with object. Any value can be stored by developer in this property.
Gets the code of last error which took place inside this object.
Removes operations with specified index.
Index of operation to remove.
True on success, false if operation index is invalid.
Checks whether current list of operations is applicable for a given shapefile.
For invalid operations get_OperationIsValid flag and get_OperationIsValidReason property are set.
Invalid operations will be skipped when when doing statistic calculations and no output fields will be created for them.
Shapefile to validate operations list against.
True if all operations are valid.
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Gets field index for operation at specified position in the list.
Index of operation in list.
Field index in input shapefile.
Gets field name for operation at specified position in the list.
Index of operation in list.
Field name in input shapefile.
Gets operation at specified position in the list.
Index of operation in list.
Operation at specified position (fsoSum will be returned in case of invalid operation index).
Gets the value of IsValid flag for operation.
The flag is set only after FieldStatOperations.Validate methods was called.
The same list of operations may be valid for one shapefile and invalid for another.
Index of operation in list.
True in case operation is valid.
Gets a value indicating the reason why the specific operation is invalid.
Index of operation to check the property for.
Reason for invalidity or fovValid in operation is applicable.
Gets or sets a Callback object which handles progress and error messages.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
A text string associated with object. Any value can be stored by developer in this property.
Gets the code of last error which took place inside this object.
Gets filename of the last datasource that was attempted to be opened.
Gets a value indicating whether the last attempt to open a datasource was successful.
Gets a strategy that was used on last attempt to open datasource.
Tries to open datasource with specified name.
Filename of datasource.
Strategy to be used with default recommended value fosAutoDetect.
Callback interface.
Return value may be either Shapefile or Image object. The latter is used for rendering both RGB images and grids.
Under the hood the function uses OpenShapefile and OpenRaster methods, so their behaviour will be consistent.
Opened datasource or null on failure.
Tries to open raster datasource (either RGB image or grid) with specified name.
Filename of datasource.
Strategy to be used with default recommended value fosAutoDetect. Three more strategies
are applicable here: fosRgbImage, fosDirectGrid, fosProxyForGrid.
Callback interface.
Image object or null on failure.
Tries to open shapefile with specified name.
Filename of shapefile to open.
Callback interface.
Shapefile object or null on failure.
Checks whether specific open strategy is applicable for a given datasource.
Filename of datasource to open.
Open strategy to check.
Inconsistent behaviour, i.e. return value is false while datasource is still can be opened with a given strategy,
should be reported as bugs. The opposite case, i.e. return value is true while datasource fails to open with given strategy,
may occur by design, but it may also be an indication of bugs in some other parts of MapWinGIS.
True in case strategy is applicable.
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Checks whether specified datasource is grid, i.e. non-RGB raster datasource which
require synthetic colour scheme for rendering.
Filename of datasource to be checked.
True in case datasource is grid.
Checks whether datasource is RGB image.
Attempt is made to open datasource with GDAL. If it succeeds, a check is made whether bands with Red, Green, Blue
colour interpretation are present in it.
True if datasource is RGB image.
Checks whether the datasource is supported (can be opened) by MapWinGis.
Filename of datasource
Under the hood open strategy will be determined with FileManager.get_OpenStrategy and then
FileManager.get_CanOpenAs(strategy) is called.
True in case datasource can be opened.
Checks whether datasource is supported by specified subsystem of MapWinGIS.
Filename of datasource
The subsystem to choose (the list may be extended later on).
True in case the datasource is supported, i.e. can be opened.
Checks whether specified datasource is vector layer that can be opened by MapWinGIS.
Filename of datasource.
Currently only shapefile format can be opened directly.
True in case datasource is vector one and is supported by MapWinGIS.
Determines optimal open strategy for datasource.
Filename of datasource.
The optimal strategy to open datasource.
Opens a layer or runs a query against OGR spatial database.
This method will search if there is a layer with specified name in the datasource,
and if so will open it. Otherwise it will run OgrDatasource.RunQuery method with provided
layerNameOrQuery argument.
Connection string. See details for particular formats here.
Name of the layer (i.e. database table) or SQL query.
Opened layer or null on failure.
\new493 Added in version 4.9.3
Clears overviews for a raster datasource managed by GDAL.
Filename of datasource.
True on success.
Builds overviews for a raster datasource managed by GDAL.
Filename of datasource.
True on success.
Remove proxy images generated for grid rendering.
Filename of grid datasource.
Returns true if specified raster datasource managed by GDAL has overviews.
Filename of datasource.
True if overviews are exist.
Returns true if specified grid datasource has proxy images for its rendering.
Filename of grid datasource.
True if proxy images exist.
Gets expression to be set for OpenFileDialog.Filter property to select supported datasources.
\new493 Added in version 4.9.3
Gets expression to be set for OpenFileDialog.Filter property to select raster datasources (both RGB images and grids).
\new493 Added in version 4.9.3
Gets expression to be set for OpenFileDialog.Filter property to select vector datasources.
\new493 Added in version 4.9.3
Gets string with the list of supported GDAL formats.
\new493 Added in version 4.9.3
Tries to open specified file as OGR datasource.
Filename of the datasource to be opened.
Instance of OgrDatasource or null on failure.
\new493 Added in version 4.9.3
Tries to open specified file as OGR layer.
When preferedShapeType is set to default ShpfileType.SHP_NULLSHAPE value or there is no layer
with preferedShapeType, then the first layer in datasource will be returned.
Filename of the datasource to be opened.
Sets type of layer to be returned from datasource in case there are multiple layers available.
True in case layer should be open in read/write mode.
Instance of OgrLayer or null on failure.
\new493 Added in version 4.9.3
Represents a single field of the attribute table.
\dot
digraph field_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
fld [ label="Field" URL="\ref Field"];
node [color = tan peripheries = 1 height = 0.3, width = 1.0];
tbl [ label="Table" URL="\ref Table"];
edge [ dir = "none", arrowhead="open", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ];
tbl -> fld [ URL="\ref Table.get_Field()", tooltip = "Table.get_Field()", headlabel = " n"];
}
\enddot
Graph description
To show the properties of the field the following code can be used:
\code
Shapefile sf = some_shapefile;
Field field = sf.get_Field(fieldIndex);
if (field != null)
{
string s = string.Format("Name = {0}; type = {1}; width = {2}; precision = {3}",
field.Name, field.Type.ToString(), field.Width.ToString(), field.Precision.ToString());
Debug.Print(s);
}
\endcode
Creates an exact copy of the field.
The copy of the field.
\new48 Added in version 4.8
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
The key may be used by the programmer to store any string data associated with the object.
Gets or sets a value indicating whether the field is visible.
For use in application only, not used by MapWinGIS internally.
\new494 Added in version 4.9.4
Gets or sets the alias for the field.
For use in application only, not used by MapWinGIS internally.
\new494 Added in version 4.9.4
Gets a value indicating whether this field is joined.
\new494 Added in version 4.9.4
Gets or sets the expression for the field.
For use in application only, not used by MapWinGIS internally.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether this field is modified.
It is used during saving of changes for OgrLayer. The flag should be set by application code.
\new494 Added in version 4.9.4
Retrieves the last error generated in the object.
Gets or sets the name of the field.
Gets or sets the precision of the field. Precision only applies to fields of fieldtype double.
Gets or sets the field type of the field.
Gets or sets the width of the field.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Holds information about coordinate system and projection of the data.
1. Formats and initialization. Information about coordinate system and projection can be represented in several formats:
- ESRI WKT string;
- proj 4 string;
- EPSG code;
.
EPSG codes represent a standardization effort to map each projection to the unique code.
It's recommended to use these codes whenever possible. GeoProjection.ImportFromAutoDetect() method implements logic to discern
the format of the provided projection string. \n
\code
GeoProjection proj = new GeoProjection();
// EPSG code
proj.ImportFromEPSG(4326); // WGS84
// proj 4 string
proj.ImportFromProj4("+proj=longlat +datum=WGS84 +no_defs"); // WGS84
//autodetect the format
string unknown_format = "4326";
proj.ImportFromAutoDetect(unknown_format);
// from file
string filename = "some_name";
proj.ReadFromFile(filename);
// show the name of the loaded projection
Debug.Print("Projection loaded: " + proj.Name);
// show proj 4 representation
Debug.Print("Proj4 representation: " + proj.ExportToProj4());
\endcode
Projection is usually stored in a separate file with .prj extension which accompany the data file.
GeoProjection.ReadFromFile() and GeoProjection.WriteToFile() to interact with projection file.\n\n
2. Classification and parameters. Coordinate systems are split in 2 broad categories:
-# Geographical:
- the data is specified in decimal degrees as a pair of latitude and longitude value;
- it implies the usage of equirectangular projection for displaying the data on the screen;
.
-# Projected:
- the Earth surface data is projected to the plane according to specific rule (projection);
- a number of projections can be used (Mercator, Transverse Mercator, Lambert conformal conic, etc),
each of the them characterized with certain distortions and certain properties of the data which are preserved
(like angles, directions, area, etc.);
- usually the data is specified in meters or feet;
.
Normally spatial reference holds the information about:
- the reference ellipsoid (GRS80, Krasovski, etc.);
- the name of datum, which defines coordinate system relative to the surface of ellipsoid (WGS84, NAD83, Pulkovo1942, etc.);
- optionally projection, if the data isn't defined in decimal degrees (UTM, Gauss-Kruger, etc).
.
\n
Use GeoProjection.IsGeographic, GeoProjection.IsProjected properties to distinguish geographical and
projected coordinate systems. To retrieve parameters of geographic coordinate system - GeoProjection.get_GeogCSParam.
To extract parameters of the projection use GeoProjection.get_ProjectionParam.\n\n
3. Well-known coordinate systems. The most widely spread geographic coordinate system is so called WGS84. It is based on WGS84 datum
and uses GRS80 ellipsoid. Universal Transverse Mercator is the most widely used projection of this coordinate system,
which defines sixty 6-degree zones which cover the whole globe. There are several methods to setup the widely used
coordinate systems and projections: GeoProjection.SetWellKnownGeogCS(), GeoProjection.SetWgs84Projection(),
GeoProjection.SetNad83Projection().\n\n
The definition of WGS84 coordinate system and projection in different formats can be as following:
-# proj4:
- geographic WGS84: +proj=longlat +datum=WGS84 +no_defs
- WGS84/UTM 10: +proj=utm +zone=10 +datum=WGS84 +units=m +no_defs \n
.
-# EPSG code:
- geographic: 4326
- WGS84/UTM 10: 32610
.
-# ESRI WKT WGS84:
\image html wgs.png
See http://spatialreference.org/ for specification of coordinate systems and projections.\n\n
4. Standardization issues. Because of the lack of standardization it's not guaranteed that subsequent exporting and importing operations for the certain projection
format (proj4, WKT, etc.) will yield the same state of the geoprojection object. Therefore it's no guaranteed way
to copy the state of the object unless knowing the way it was initialized.\n\n
The different variants for specification of the same projection even in the same format became quite a problem for GIS
software. GeoProjection.get_IsSame and GeoProjection.get_IsSameExt perform the comparison of 2 projections.
The task is critical when one need to determine whether the data from several sources will be displayed correctly on the screen.
.
\new48 Added in version 4.8
Copies information from another GeoProjection object.
The geoprojection to copy information from.
True on success and false otherwise.
Exports information to the proj4 format.
The string with proj4 projection.
Exports information to the WKT format.
The string with WKT projection.
Returns the name of the coordinate system.
An empty string will be returned unless GeoProjection.IsGeographic property returns true.
Gets or sets a callback object which is used to report errors.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Initializes geoprojection from the input string of arbitrary format.
See GDAL documentation on particular formats supported.
The string to initialize projection from.
True on success and false otherwise.
Initializes geoprojection object from EPSG numeric code.
EPSG code.
True on success and false otherwise.
Initializes geoprojection object from ESRI WKT format.
The string in the ESRI WKT format.
True on success and false otherwise.
Initializes geoprojection object from proj4 format.
The string in the proj4 format.
True on success and false otherwise.
Initializes geoprojection object from OGC WKT format.
The string in the OGC WKT format.
True on success and false otherwise.
Returns the inverse flattening of the reference ellipsoid of the coordinate system.
Gets a boolean value which indicates whether any projection definition is stored in the object.
Gets a boolean value which indicates whether the coordinate system stored in the object is the geographic one.
Gets a boolean value which indicates whether the coordinate system stored in the object is the local one.
Gets a boolean value which indicates whether the coordinate system stored in the object is the projected one.
A text string associated with the instance of the class. Any value can be stored by developer in this property.
Retrieves the numeric code of the last error that took place in the class.
The usage of this property clears the error code.
Returns the name of the coordinate system.
Either GeoProjection.GeogCSName or GeoProjection.ProjectionName will be returned
depending on the type of coordinate system.
The name of the projected coordinate system.
An empty string will be returned unless GeoProjection.IsProjected property returns true.
Initializes geoprojection from the specified file.
The method is used by MapWinGIS for reading projection of the data layer.
The file with projection must have the same name as the name of the data file and .prj extension.
The name of the file to read projection string from.
True on success and false otherwise.
Returns the half of the major axis of the reference ellipsoid.
Returns the half of the minor axis of the reference ellipsoid.
Initializes the object with NAD83 projection specified by enumerated constant.
Numeric code of the projection (EPSG code).
Initializes the object with well known geographic coordinate system.
Numeric code of the projection (EPSG code).
Initializes the object with WGS84 projection specified by enumerated constant.
Numeric code of the projection (EPSG code).
Writes projection string in ESRI WKT format to the specified file.
The name of the file to write the string in.
True on success and false otherwise.
Gets the description of the specific error code.
The error code returned by ShapefileCategories.LastErrorCode.
The string with the description.
Returns a boolean value which indicates whether 2 projections are identical.
Projections will be reported as non-identical if at least one of parameters
differ between them, even if it doesn't affect the reprojection process. For example,
different name of the datums, while all the parameters of the datums match.
The projection object to compare the current projection with.
True in case the projection definitions are identical and false otherwise.
Performs a test of identity for 2 projections.
The method perform reprojection of the random points in the given extents to WGS84
coordinate system (EPSG:4326) for both projections being compared. In case the
coordinates of the projected points match - projections are considered the same.
This doesn't mean that result of test will be the same for some other extents or that
projection definitions are completely identical. But it ensures that data layers with
these 2 projection can be displayed jointly within the tested extents.
The compared projection definition.
The bounding box to take random points for comparison from.
Number of the random points to take for sampling.
True in case the projections proved to be identical and false otherwise.
Returns a boolean value which indicates whether 2 projections belong to the same geographic coordinate system.
The compared projection definition.
True in case projection share the same geographic coordinate system and false otherwise.
Returns specified parameter of the projection
The parameter to return.
The returned value of the parameter.
True on success and false otherwise.
Gets a value indicating whether transformation to some target projection was opened with GeoProjection.StartTransform() call.
Opens transformation to the specified target projection. The transformation will be used by GeoProjection.
Transform calls until GeoProjection.StopTransform is called.
The target projection.
True if transformation is created and false on failure.
Stops transformation created by GeoProjection.StartTransform call.
Transforms a single point from this projection to target projection specified in GeoProjection.StartTransform call.
X coordinate of point to transform.
Y coordinate of point to transform.
True on success.
Returns object to initial empty state.
\see GeoProjection.IsFrozen
\new491 Added in version 4.9.1
Creates a copy GeoProjection object
A copy of GeoProjection object.
It's not guaranteed that exact clone will be created. The method uses
GeoProjection.ExportFromWKT and GeoProjection.ImportFromWKT pair of methods which may yield slightly different result,
as ExportToWKT may add defaults for parameters missing in initial Proj4 definition.
\new491 Added in version 4.9.1
Gets a value indicating whether the object can be changed.
When frozen all the methods which can change the inner state of object will fail.
The property is set to true for map projection applied with AxMap.SetGeoProjection (see details there).
\new491 Added in version 4.9.1
Sets so called Google Mercator projection (aka Spherical Mercator; EPSG:3857),
commonly used by tile servers.
True on success.
\new490 Added in version 4.9.0
Sets WGS84 geographic coordinates system (EPSG:4326).
Equirectangular projection will be implicitly used during rendering.
True on success.
\new491 Added in version 4.9.1
Tries to determine EPSG code projection currently stored in the object.
Determined epsgCode or -1 on failure.
It uses GDAL's OGRSpatialReference.AutoIdentifyEPSG method and recognized
limited number of commonly used coordinate systems (WGS84, NAD83, etc) and their zonal projections,
plus information stored in Authority node for WKT format will be used as well.
True on success.
\new491 Added in version 4.9.1
Gets the linear units from projection definition.
Writes projection string to a file.
The filename.
If set to true ESRI WKT format is used.
True on success.
\new494 Added in version 4.9.4
Reads projection string from a file.
The filename.
If set to true ESRI WKT format is used.
True on success.
\new494 Added in version 4.9.4
Exports projection string to ESRI WKT format.
Resulting string.
\new494 Added in version 4.9.4
An interface for callback objects which can be used to return information about progress and errors.
Here is an example which demonstrates the usage of Callback.
\code
public void Test()
{
Shapefile sf = new Shapefile();
sf.GlobalCallback = new Callback();
}
class Callback : ICallback
{
public void Error(string KeyOfSender, string ErrorMsg)
{
Debug.Print("Error reported: " + ErrorMsg);
}
public void Progress(string KeyOfSender, int Percent, string Message)
{
Debug.Print(Message + ": " + Percent + "%");
}
}
\endcode
A function to report the information about an error.
The key associated with the object in which error took place.
The description of the error.
A function to report the information about progress of the task.
The key associated with the object in which error took place.
The percent of completion (from 0 to 100).
The information about the task being executed.
Holds global settings for MapWinGIS. Allows to retrieve GDAL errors.
All the properties of this class are defined as global variables and therefore changes in any instance of this
class will affect all the instances of MapWinGIS control hosted by the application.\n\n
The major part of properties require advanced understanding of MapWinGIS functioning therefore it's not recommended
to change them without a good reason.\n\n
Sometimes properties can be added to this class to provide a switch for testing new functions.
Such properties may be removed afterwards (GlobalSettings.ShapefileFastUnion for example).
\new48 Added in version 4.8
Gets a sets a value which defines the multiplication coefficient for data in decimal degrees.
The value is used for Clipper library due to the lack of built-in scaling in it. The default value is 10000.0.
Gets or sets a value which is used to weed out long narrow "splintered" polygons generated by geoprocessing routines.
Polygons with area to perimeter ratio less than this values won't be passed to the output.
The default value is 0.0001.
Gets or sets the minimal area of polygon which will be passed to the output by geoprocessing routines.
When the data is defined in decimal degrees, this value will be divided into squared conversion factor
between decimal degrees and meters (roughly 110000 per degree).
The default value is 1.0.
Gets or sets the value which indicates whether all the new instances of Shapefile class will be initialized with the fast mode turned on.
The default value is false.
\see Shapefile.FastMode
Extracts the last error message reported by GDAL library.
Gets a subtype of the last error reported by GDAL library.
Gets a type of the last error reported by GDAL library.
Gets last error reported by GDAL reprojection routine.
Can be used to find out the source of failure of Shapefile.Reproject and Shapefile.ReprojectInPlace functions.
Gets or sets GDI+ compositing quality for label drawing which will be used for all newly added layers.
The default value is HighQuality.
Gets or sets GDI+ smoothing mode for label drawing which will be used for all newly added layers.
The default value is HighQualityMode.
Clears information about last GDAL error.
Affects GdalLastErrorMsg, GdalLastErrorNo, GdalLastErrorType, GdalReprojectionErrorMsg properties.
Gets or sets a value which affects the speed of Shapefile.Union operation.
The default value is true.
Gets or sets format to be used for displaying grid datasources using image proxy.
Methods like Grid.HasImageProxy or Grid.RemoveImageProxy will only
take into account the format chosen in these property.
\new490 Added in version 4.9.0
Gets or sets preferred display mode for grid datasources.
This property will be used in AxMap.AddLayer and Grid.OpenAsImage methods
if Grid.PreferedDisplayMode is set to gpmAuto.
\new490 Added in version 4.9.0
Sets collision mode for all instances of Labels class (which represent labels for either shapefiles or images).
\new490 Added in version 4.9.0
Gets or sets maximum allowable size in MB for a grid datasource to be opened without proxy creation.
For grids with size exceeding the value of this property, proxy image will be created when GridProxyMode
is set to gpmAuto or gpmFavourNoProxy; for gpmNoProxy Grid.CanDisplayWithoutProxy will return false
and Grid.OpenAsImage will fail. Grids of smaller size will be rendered directly for all the modes but gpmUseProxy if
datasources format allows it (see Grid.CanDisplayWithoutProxy).
Default value is 20.0 MB. Zero of negative values set no limitation.
Direct rendering of grid datasources is computationally expensive process
therefore for large datasources rendering may become too slow.
\new491 Added in version 4.9.1
Gets or sets the maximum allowable number of unique values in grid color scheme.
Affects Grid.GeneratedColorScheme when generation method is set to gsgUniqueValues or gsgUniqueValuesOrGradient.
\new491 Added in version 4.9.1
Gets or sets a value indicating whether a map will zoom automatically to the first layer added with AxMap.AddLayer.
\new491 Added in version 4.9.1
Gets the localized version for a specified string used in GUI.
String to get localized version for.
Localized string.
\new491 Added in version 4.9.1
Sets the localized version for a specified string used in GUI.
String to set localized version for.
Localized string.
\new491 Added in version 4.9.1
Gets or sets colour scheme to be used for rendering grids.
The value will be used on passing Grid object to AxMap.AddLayer method.
\new491 Added in version 4.9.1
Gets or sets initial value to be set for Shapefile.GeometryEngine property of newly created shapefiles.
\new491 Added in version 4.9.1
Gets or sets a value indicating whether colour scheme set in
GlobalsSettings.DefaultColorSchemeForGrids or a radom one should be used on opening grids.
The value will be used on passing Grid object to AxMap.AddLayer method.
\new491 Added in version 4.9.1
Gets or sets a value indicating whether colour scheme for grid will be saved to .mwleg
to be reused on the next opening.
This value affects only grid datasources rendered by Image class directly.
Colour scheme for proxy images will be written on disk despite this values. Without them those proxies become meaningless.
\new491 Added in version 4.9.1
Sets validation mode for input of geoprocessing operations.
This setting affects only Shapefile objects, while it it doesn't affect
single shapes passed as parameters. Check results of validation in Shapefile.LastInputValidation.
\new491 Added in version 4.9.1
Sets validation mode for output of geoprocessing operations.
This setting affects only methods where Shapefile objects are returned as output,
single shapes returned as output are not affected. Check results of validation in Shapefile.LastOutputValidation.
\new491 Added in version 4.9.1
Gets or sets default value of Image.DownsamplingMode property.
\new492 Added in version 4.9.2
Gets or sets default value of Image.UpsamplingMode property.
\new492 Added in version 4.9.2
Gets or sets a value indicating whether layer symbology from .mwsymb XML file
should be automatically applied on adding layer to the map.
\new492 Added in version 4.9.2
Gets or sets the minimum width of image for GDAL overviews to be created.
For images with smaller width no GDAL overviews will be created.
\new492 Added in version 4.9.2
Gets or sets a value indicating whether automatic creation of GDAL overviews will
be performed for large datasets.
Currently applied to grid datasets only (both direct and proxy rendeing).
No automatic overview creation for RGB image is implemented so far.
\new492 Added in version 4.9.2
Gets or sets resampling method for creation of GDAL overviews.
\new492 Added in version 4.9.2
Gets or sets compression mode to be used for TIFF proxies created for grid rendering.
\new492 Added in version 4.9.2
Gets or sets minimum available zoom level for tiles when map projection and server projection don't match.
This value will be used for any provider which uses Spherical Mercator projection
while map projection isn't set to Spherical Mercator or WGS84. The default value is 6.
Smaller zoom levels (1-5) typically have severe distortions caused by coordinate transformation
which makes them unusable. Tiles won't be displayed at all for these levels and they will
not be included into zoom bar.
\new492 Added in version 4.9.2
Gets or sets the number of threads to be used for downloading tiles from remote server.
Default value is 5. Increasing the number of threads doesn't necessarily lead to better
performance as servers may limit the number of simultaneous connections from the same IP
address.
\new492 Added in version 4.9.2
Gets or sets string encoding used to communicate with OGR drivers.
\new493 Added in version 4.9.3
Gets or sets the maximum number of features that can be loaded into memory for a single
OGR layer.
\see OgrLayer.MaxFeatureCount
\new493 Added in version 4.9.3
Gets or sets a value which indicates whether OgrLayer.DynamicLoading mode will
chosen automatically based on the number of features. The default value is true.
\new493 Added in version 4.9.3
Gets or sets maximum number of shapes within view for hot tracking functionality to work.
Hot tracking is used by cmIdentify tool and interactive editing tools.
\see Identifier.HotTracking, ShapeEditor.HighlightVertices.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether layers without metadata about coordinate system / projection can be added to the map.
The default value is true. The decision can also be made on per-layer bases
by handling AxMap.LayerProjectionIsEmpty event.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether layers with coordinate system / projection different from those of the map can be added to the map.
In most cases it's not advisable to allow projection mismatch, since relative position of layers with different
projections won't be correct. The default value is false. The decision can also be made on per-layer bases
by handling AxMap.ProjectionMismatch event.
\new493 Added in version 4.9.3
Gets or sets global callback object to report information about progress and errors taking place inside MapWinGIS.
The callback object set by this property will override all callback set for particular classes
(like %Shapefile.GlobalCallback, %AxMap.GlobalCallback). Also it will automatically display internal GDAL error messages.
\note It's strongly recommended to use this property rather than setting callback for each and every class.
\new493 Added in version 4.9.3
Gets or sets a value which limits the maximum number of shapes within a vector layer to run on-the-fly reprojection.
This property is taken into account when projection mismatch occurs on adding a new layer to the map.
\new493 Added in version 4.9.3
Gets or sets a value which determines how close to a particular object mouse cursor should be
in order to select it with mouse click.
\new493 Added in version 4.9.3
Gets or sets a value which determines whether automatic on-the-fly reprojection of the vector layer
will be performed on adding a new layer to the map with different projection.
The decision can also be made on per-layer bases by handling AxMap.ProjectionMismatch event.
\see MaxReprojectionShapeCount
\new493 Added in version 4.9.3
When set to true rendering hint for Labels will be chosen automatically to ensure better performance and visual quality.
\see Labels.TextRednderingHint
\new493 Added in version 4.9.3
When set to true, any labels added to any instance of AxMap won't be rendered.
\new493 Added in version 4.9.3
Gets the version of GDAL library which current build of MapWinGIS uses.
\new493 Added in version 4.9.3
When set to true the opening of any OGR layer will be first made with forUpdate parameter.
If this first attempt fails, the layer will be opened without update flag.
\see OgrLayer.SupportsEditing
\new493 Added in version 4.9.3
Gets or sets pixel offset mode to be used during the rendering of vector layers.
\new493 Added in version 4.9.3
Gets or sets the path where data necessary for GDAL coordinate systems / projections will be searched for.
This property effectively overrides GDAL_DATA environment variable. By default
it's set to gdal-data folder in the directory where MapWinGIS is installed.
\new493 Added in version 4.9.3
Gets or sets the path where GDAL plug-ins will be searched for.
This property effectively overrides GDAL_DRIVER_PATH environment variable. By default
it's set to gdalplugins folder in the directory where MapWinGIS is installed.
\new493 Added in version 4.9.3
Gets or sets API key to access Bing maps. Without API key Bing Maps provider isn't available. See
details here.
\new493 Added in version 4.9.3
Sets application credentials for Here Maps online tiles.
Without these credentials Here Maps providers are not available. See
details here.
Application Id. Can be obtained by registering on the site of the service.
Application code. Can be obtained by registering on the site of the service.
\new493 Added in version 4.9.3
Requests URL address for tiles download from Bing Maps server.
API key to test.
True if the Url for downloading for obtained.
\new493 Added in version 4.9.3
Gets or sets the value indicating which compression mode will be used to compress image overviews.
The compress overviews.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether greyscale or color scheme rendering will be used for grids by default.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether histogram will be computed and news for grid by default.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether instances of ICallback assigned to particular classes will be overriden by
global callback assined to GlobalSettings.ApplicationCallback property.
true if [override local callback]; otherwise, false.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether caching DBF records is on.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether caching of rendering data for shapes is on.
\new494 Added in version 4.9.4
Gets the filename of the file to log TMS/WMS requests to.
\new494 Added in version 4.9.4
Gets a value indicating whether tile log is opened.
Gets or sets a value indicating whether only errors will be logged to the for TMS/WMS requests.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether WMS data will cached to the disk by default.
\new494 Added in version 4.9.4
Gets or sets the callback verbosity.
\new494 Added in version 4.9.4
Share connection between layers (may be unstable).
For large read-only layers it will increase performance.
\new494 Added in version 4.9.4
Starts logging of tile requests.
The filename.
If set to true only errors will be logged.
True on success.
\new494 Added in version 4.9.4
Assign new projection to the grid.
Projection string in proj4 format.
True on success or false otherwise.
Returns the common dialog filter containing all supported file extensions in string format.
Uses a cell's column and row position to find the center of the cell in projected map coordinates.
The column of the cell to find the center in projected map coordinates.
The row of the cell to find the center in projected map coordinates.
Returns the x projected map coordinate of the center of the specified cell.
Returns the y projected map coordinate of the center of the specified cell.
Clears all data in the grid, setting the value of all cells in the grid to the specified clear value.
The value to set all of the grid's cells to.
A boolean value representing the success or failure of clearing the grid.
Closes the grid.
A boolean value representing the success or failure of closing the grid.
Creates a new grid.
The filename for the new grid.
The header defining the attributes of the new grid.
The data type of the new grid.
The initial value for each cell of the new grid.
Optional. A boolean value representing the grid being stored in memory(RAM) when True, and the
grid being stored on disk when False.
Optional. The grid file type.
Optional. The ICallback object that will receive the progress and error events during the creation of the new grid.
A boolean value representing the success or failure of the creation of the new grid.
Returns the data type of the values stored in the grid.
The filename associated with the object.
Returns an array with grid values which lie within specified bounds.
For inner use or C++ use only. Only a single value will be returned to .NET.
The start row of the window.
The end row of the window.
The start colour of the window.
The end colour of the window.
A supposed array (only a single value in .NET).
True on success and false otherwise.
The faster way to read the array values that are of a specific size.
The row is the integer row to read from the grid
object. The vals variable is actually the first element of the array of floats that you want to be populated with the values from
the grid. Since arrays are stored sequentially in memory, passing the first element allows the prediction of where the other
values must go. It is very important that you always dimension the array as being of type float, and always make sure that
you dimension it from 0 to numCols - 1.
The Integer value of the row to retrieve values for.
Reference to the first element of the array of floats that will hold the row of values.
True on success and false otherwise.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Returns the header of the grid.
Returns whether the grid is loaded in to RAM memory or not.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Opens a grid.
The filename of the grid to be opened.
Optional. The data type of the grid to be opened.
Optional. A boolean value representing whether the grid will be stored in RAM or on disk.
Optional. The file type of the grid. The default file type is "Use Extension".
Optional. The ICallback object that will receive the progress and error events during the creation
of the new grid.
A boolean value that represents the success or failure of opening the grid.
Converts a point in projected map coordinates to a cell (column, row) in the grid.
If the point lies outside the bounds of the grid, a column and row are returned which are outside the boundaries of the grid.
For example, if the point lies to the left or lies below the grid boundaries, a negative column or row will be returned. Similarly,
if the point lies above or to the right of the grid boundaries, a column or row which is greater than the number of columns or rows will be returned.
The x projected map coordinate for which the corresponding cell in the grid is required.
The y projected map coordinate for which the corresponding cell in the grid is required.
The column the specified point lies within. This value may not be within the valid bounds of the grid.
The row the specified point lies within. This value may not be within the valid bounds of the grid.
Sets an array of values for a given region of the grid.
The start row of the window.
The end row of the window.
The start colour of the window.
The end colour of the window.
A supposed array (only a single value in .NET).
True on success and false otherwise.
Provides The faster way to write the array values that are of a specific size.
The row is the integer row to read from the grid
object. The vals variable is actually the first element of the array of floats that you want to be populated with the values from
the grid. Since arrays are stored sequentially in memory, passing the first element allows the prediction of where the other values must go. It is very important that you always dimension the array as being of type float, and always make sure that
you dimension it from 0 to numCols - 1.
The Integer value of the row to retrieve values for.
Reference to the first element of the array of floats that will hold the row of values.
True on success.
Gets grid colour scheme object used for rendering of the image representation of the grid, in case
the datasource has a color table (GTiff with indexed colors, for example).
Changes the grid source without closing it.
The name of the new file source.
True on success and false otherwise.
Saves the grid.
Optional. The filename the grid will be saved under.
If no filename is specified the filename in the grid's Filename property is used.
Optional. The file type to save the grid as.
If no type is specified, the type stored in the grid object is used.
Optional. The ICallback object that will receive the progress and error events during the creation of the new grid.
A boolean value representing the success or failure of saving the grid.
Sets invalid values to no data values.
The minimum valid value.
The maximum valid value.
True in success and false otherwise.
Retrieves the error message associated with the specified error code.
The numeric code of error returned by Grid.LastErrorCode.
The description of the error.
Returns the value stored in the grid at the specified cell.
The column representing the cell for which the value is required.
The row representing the cell for which the value is required.
The value stored in the grid in the specified cell.
Sets the value of the specified cell of the grid.
The index of the cell's column.
The index of the cell's row.
The new value as variant data type.
The index of the active band within grid.
Active band will be used on data extraction operation like Grid.get_Value, Grid.GetFloatWindow
and during creation of image proxy.
\new490 Added in version 4.9.0
Gets the value indicating whether grid source can be displayed by Image class without creation of proxy file.
Check return value for the reason whey such rendering isn't possible.
\new491 Added in version 4.9.1
Creates a proxy image file to display grid data.
Colour scheme which specified how the data will be visualized.
Created image proxy or null if the operation failed.
The format of proxy can be changed in GlobalSettings.GridProxyFormat.
\new491 Added in version 4.9.1
Gets extents of the grid.
\new490 Added in version 4.9.0
Generates colour scheme for the grid.
Method of generation to be used.
Predefined colour scheme to be mapped to the values of grid.
Generated colour scheme or null if the operation failed.
\new491 Added in version 4.9.1
Gets the value indicating whether grid has a valid image proxy for visualization.
To be considered valid the proxy must have proper name (with "_proxy" postfix) and colour scheme file (.mwleg).
Both this files must have older creation date than the grid source file itself.
\new491 Added in version 4.9.1
Returns the maximum value stored in the grid.
Returns the minimum value stored in the grid.
Gets the number of within the grid.
\new490 Added in version 4.9.0
Opens grid as image.
Colour scheme which specifies how grid will be visualized.
Proxy mode to be used.
Callback interface.
Resulting image object or null if the operation failed.
Depending on the proxy mode, grid datasource can be opened directly, or a proxy file can be created.
\new491 Added in version 4.9.1
Makes the specified band of the grid active.
Index of the band to be set active.
True on success and false otherwise.
\new490 Added in version 4.9.0
Gets or sets the value indicating how the grid should be displayed.
This value will be used in AxMap.AddLayer and Grid.OpenAsImage methods.
\new491 Added in version 4.9.1
Removes proxy image file created for grid display.
True on success or if there is no image proxy and false if the operation failed.
Only the proxy format set in GlobalSettings.GridProxyFormat will be removed.
\new491 Added in version 4.9.1
Retrieves colour scheme from the grid.
Retrieval method. Use Auto to try all the available method.
Colour scheme object or null if the operation failed.
Is different from Grid.GenerateColorScheme,
as it get colour scheme already stored in the grid itself or as an external .mwleg file rather than creating a completely new one.
\new491 Added in version 4.9.1
Tries to retrieve any existing color scheme associated with grid or generates a new one if none is found.
Colour scheme retrieval method.
Colour scheme generation method
Predefined set of colours to be mapped to grid values during generation process.
Color scheme or null if both retrieval and generation failed.
\new491 Added in version 4.9.1
Gets the type of grid source, which defines a) whether any grid source is opened and b) if so, what the inner representation of grid by MapWinGIS.
The functionality and behaviour of various source types may differ.
\new490 Added in version 4.9.0
Returns an array with grid values which lie within specified bounds. Double overload of Grid.GetFloatWindow method.
For inner use or C++ use only. Only a single value will be returned to .NET.
The start row of the window.
The end row of the window.
The start colour of the window.
The end colour of the window.
A supposed array (only a single value in .NET).
True on success and false otherwise.
\new491 Added in version 4.9.1
Provides the faster way to read the array values that are of a specific size. Double overload of Grid.GetRow.
The row is the integer row to read from the grid
object. The vals variable is actually the first element of the array of floats that you want to be populated with the values from
the grid. Since arrays are stored sequentially in memory, passing the first element allows the prediction of where the other
values must go. It is very important that you always dimension the array as being of type double, and always make sure that
you dimension it from 0 to numCols - 1.
The Integer value of the row to retrieve values for.
Reference to the first element of the array of doubles that will hold the row of values.
True on success and false otherwise.
\new491 Added in version 4.9.1
Sets an array of values for a given region of the grid. Double overload of Grid.PutFloatWindow.
The start row of the window.
The end row of the window.
The start colour of the window.
The end colour of the window.
A supposed array (only a single value in .NET).
True on success and false otherwise.
\new491 Added in version 4.9.1
Provides The faster way to write the array values that are of a specific size. Double overload of Grid.PutRow.
The row is the integer row to read from the grid
object. The vals variable is actually the first element of the array of floats that you want to be populated with the values from
the grid. Since arrays are stored sequentially in memory, passing the first element allows the prediction of where the other values must go. It is very important that you always dimension the array as being of type float, and always make sure that
you dimension it from 0 to numCols - 1.
The Integer value of the row to retrieve values for.
Reference to the first element of the array of doubles that will hold the row of values.
True on success.
\new491 Added in version 4.9.1
Gets datasource band with specified index.
Index of the band.
The band or null if index is not valid.
\new494 Added in version 4.9.4
Gets the active band of the datasource.
\new494 Added in version 4.9.4
A grid color break object defines how a specified region of a grid will be colored.
Represents a part of the GridColorScheme.
Gets or sets the caption to display for the color break
Gets or sets the way a break is colored.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Gets or sets the model used to color the break.
Gets or sets the color representing the highest value in the color break.
Gets or sets the highest value in the color break.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Gets or sets the lowest value in the color break.
Gets or sets the lowest value in the color break.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Gets or sets a value indicating whether the break is visible.
\new494 Added in version 4.9.4
A grid color scheme defines how a grid will be colored.
A grid color scheme may either contain grid color breaks created by
the user, or may use a predefined color scheme.
Gets or sets the intensity of the ambient lighting for the color scheme. Only applies when creating hillshaded breaks.
Clears all color breaks in the color scheme.
Deletes the specified color break from the color scheme.
The index of the color break to be removed.
Restores the setings of the grid from the string generated by Grid.Serialize() method.
The string with grid settings.
Gets the direction the light source is pointing for the color scheme in the form of a vector which originates from the light
source. This only applies to hillshaded breaks.
The direction the light source is pointing represented by a vector.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Inserts a break at the specified position of the color scheme.
The position to insert the break at.
The grid color break.
Adds a break to the color scheme.
The grid color break.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Gets the azimuth, or compass heading of the light source. Only applies to hillshaded breaks.
Gets the elevation of the light source. Only applies to hillshaded breaks.
Gets or sets the intensity of the light source for the color scheme. Only applies to hillshaded breaks.
The color to use for the color scheme when drawing grid cells with a no-data value.
Gets the number of color breaks in the color scheme.
Serializes the setting of the grid to the string.
The string with serialized setting of empty string on failure.
Sets the direction of the light source.
The azimuth heading of the light source. Also known as the compass heading.
The elevation of the light source.
Loads the values into the color scheme from pre-defined color scheme.
The lowest value in the grid.
The highes value in the grid.
Optional. The pre-defined color scheme to be used. The default is
MapWinGIS.PredefinedColorScheme.SummerMountains.
Gets a break from the color scheme using the specified index.
The index of the color break to be returned.
The color break specified by the index.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
A shortcut to apply new coloring type for each of the breaks of the colors scheme.
New coloring type.
\new491 Added in version 4.9.1
A shortcut to apply gradient model for each of the breaks of the colors scheme.
New gradient model.
\new491 Added in version 4.9.1
Reads color scheme from .mwleg XML file.
Filename to read color scheme from.
The name of node to read from (usually GridColoringScheme).
True on success.
\new491 Added in version 4.9.1
Writes color scheme to the specified file.
Filename to write color scheme into.
The name of the source grid without path (should be located in the same folder). Default value is empty string.
Band index the color scheme was created for. Default value is 1.
True on success.
\new491 Added in version 4.9.1
Applies specified colors to the exiting breaks of GridColorScheme.
Type of the scheme.
Colors to apply.
If true gradient within each category will be set.
True on suceess.
\new494 Added in version 4.9.4
A grid header object is used to hold the information contained in a grid's header
Gets or sets a text string with information about color table. This value doesn't affect grid processing.
Copies the contents of another instance of the grid header.
The grid header to copy setting from.
Not implemented. Get or sets the geoprojection associated with grid header.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
The value representing cells in the grid with no-data or missing data values.
Gets or sets notes or any additional information about the grid stored in the grid header.
Gets or sets the number of columns for the grid represented by the grid header.
Gets or sets the number of rows in the grid represented by the grid header.
Gets or sets information about the projection of the grid represented by the grid header. Setting this value has no effect on
the actual grid data. The projection should be expressed as a PROJ4 string.
The x coordinate of the center of the lower-left cell in the grid represented by the grid header.
Gets or sets the y coordinate of the center of the lower-left cell in the grid represented by the grid header.
Gets or sets the width of the grid cell in physical units for the grid represented by the grid header
Gets or sets the height of a cell in the grid represented by the grid header.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
For inner use only.
Represents an raster image of particular format which may be added to the map.
\dot
digraph image_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 1, fontname=Helvetica, fontsize=9, color = tan, style = filled, height = 0.3, width = 1.0];
lbs [ label="Labels" URL="\ref Labels"];
node [style = dashed, color = gray];
map [ label="AxMap" URL="\ref AxMap"];
node [color = gray, peripheries = 3, style = filled, height = 0.2, width = 0.8]
img [ label="Image" URL="\ref Image"];
edge [dir = "none", dir = "none", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
img -> lbs [ URL="\ref Image.Labels()", tooltip = "Image.Labels()", headlabel = " 1"];
map -> img [URL="\ref AxMap.get_Image()", tooltip = "AxMap.get_Image()", headlabel = " n"]
}
\enddot
Graph description\n\n
Here is a diagram with groups of API members for Image class.
\dotfile imagegroups.dot
Graph description\n\n
Types of image handling.\n\n
The class is a wrapper for several representation of images used internally:\n\n
1. In-RAM images created with Image.CreateNew method and not bound to any file;
- data for each pixel is stored in the memory as R, G, B bytes; no semitransparency is stored;
- can be edited and saved in several formats with Image.Save() method.
2. Disk-based images handled by MapWinGIS own driver;
- available for BMP format only;
- support editing with immediate saving to the source file.
3. GDAL-based images:\n
- data is accessed by GDAL drivers;
- suitable for rendering very large images especially when overviews are preliminary created (Image.BuildOverviews);
- before each redraw the requested part of image is read into memory buffer;
- doesn't support editing of data (values in memory buffer can be changed with Image.set_Value but these changes can't be saved to disk).
Inner representation of image can be determined via Image.SourceType property.
Some properties and methods are applicable to the GDAL images only.\n
\addtogroup image_gdal GDAL images
Here is a list of methods and properties that are specific for images accessed through GDAL library.
The properties and methods described here belong to Image class.
\dot
digraph image_common {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Image" URL="\ref Image"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="GDAL images" URL="\ref image_common"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Gets or sets the size of image buffer in percentage.
The values less than 100 will increase performance of drawing at the cost of decreasing the visual quality.
Converts the position of pixel in image buffer to the map coordinates.
The x coordinate of the pixel.
The y coordinate of the pixel.
The resulting x coordinate of the map.
The resulting y coordinate of the map.
\new48 Added in version 4.8
Builds overviews for GDAL image.
Overviews are the images with lower resolution which are used as a replacement for the
original image while drawing it at small scales. The usage of overviews can significantly
improve performance and is highly recommended for large images.
The resampling method to use for generation of the image with lower resolution.
The number of overviews. Should be equal to the size of OverviewList.
An array of integer type with the specification of overviews (magnification ratios).
True on success and false otherwise.
\new48 Added in version 4.8
Clears the cache of GDAL library which can be used for faster display.
\new48 Added in version 4.8
Loads the whole image in the memory buffer of specified size. Applicable for GDAL images only.
If the buffer size is smaller than image disk size, the image will be resampled, by decreasing
it's linear dimensions by 2.
The maximum size of buffer in MB.
True on successful loading and false otherwise.
\new48 Added in version 4.8
Returns the number of bands of GDAL image.
Returns the number of overviews for GDAL image.
\see Image.BuildOverviews.
\new48 Added in version 4.8
Gets the type of palette interpretation. Applicable for GDAL images only.
The possible values are
- "Grayscale";
- "Red, Green, Blue and Alpha";
- "Cyan, Magenta, Yellow and Black";
- "Hue, Lightness and Saturation";
- "Unknown".
Gets or sets a boolean value which indicates whether a histogram will be used. Applicable for GDAL images only.
Sets no-data value for the image. Applicable for GDAL images only.
The pixels with this value will be treated as transparent.
The value to be set.
A boolean output value which indicates the success of the operation.
\new48 Added in version 4.8
Returns a boolean value which indicates whether an image has a color table. Applicable for GDAL images only.
Reloads the image buffer to represent the specified map extents. Applicable for GDAL images only.
In most cases the method must not be called directly, as MapWinGIS reloads the buffers for the images
automatically after zooming operations.
The minimal x coordinate of the new extents.
The minimal y coordinate of the new extents.
The maximum x coordinate of the new extents.
The maximum y coordinate of the new extents.
The number of image pixels which fall into the specified extents.
This parameter is no longer used.
Returns true if the datasource represents RGB image.
The property can be used to distinguish grid datasource from genuine images.
Implementation checks if all 3 R,G,B colors are set as color interpretation for GDAL bands.
Any additional bands will be ignored.
\new491 Added in version 4.9.1
Returns true if the image is warped, i.e. there are rotation parameters in world file.
\new490 Added in version 4.9.0
\addtogroup image_common Image common
Here is a list of methods and properties that are common for all images despite their source.
The properties and methods described here belong to Image class.
\dot
digraph image_management {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Image" URL="\ref Image"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Open and close" URL="\ref image_common"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Returns the filename of the datasource for an image.
For proxy image grid filename will be renamed, in other cases Filename of Image itself.
\new491 Added in version 4.9.1
Returns the common dialog filter containing all supported file extensions in string format.
Clears the image using the specified canvas color as the new color for every pixel in the image.
The color to be used to as the new color of every pixel in the image. This is a UInt32
representation of an RGB value.
Optional. The ICallback object that will receive the progress and error events while the image is cleared.
A boolean value representing the success or failure of clearing the image.
Closes the image.
True on successful release of the resources and false otherwise.
This value can be omitted.
Creates a new image with specified width and height.
The width of the new image in pixels.
The height of the new image in pixels.
A boolean value representing the success or failure of creating the new image.
Restores the properties of the image object from the serialized string.
The serialized string generated by Image.Serialize() method.
\new48 Added in version 4.8
The filename associated with the object.
Opens an image from file.
The filename of the image to be opened.
Optional. The type of image being opened. The default is "USE_FILE_EXTENSION".
Optional. A boolean value representing whether the image is stored in RAM memory while open.
The default is false. The settings affects only BMP images, as other image types are handled by GDAL.
Image.IsInRam property will be set to true for them, but only memory will only hold a buffer currently displayed on screen.
Optional. The ICallback object which will receive progress and error events while the image is being opened.
A boolean value representing the success or failure of opening the image.
Gets the image object's image type.
Returns true when the image is loaded in RAM memory, and returns false when the image is not loaded in RAM memory.
Changes the data source of the image object without the its closing.
The new file to serve as a datasource for the image object.
True on success and false otherwise.
Saves the image to file.
The filename to use to save the image.
Optional. A boolean value representing whether a world file is also written. The default is false.
Optional. The file type to use to save the image. Default is "USE_FILE_EXTENSION".
Optional. The ICallback object which will receive the progress and error messages while the image is being saved.
A boolean value representing the success or failure of saving the image.
Serializes the image properties to the string.
A boolean value which indicates whether image pixels should be serialized.
The serialized string.
\new48 Added in version 4.8
Gets or sets instance of the labels class associated with the image.
\new48 Added in version 4.8
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
The key may be used by the programmer to store any string data associated with the object.
The source type of the image.
Images start with istUninitialized state. After loading bmp images istDiskBased or istInMemory value will be set depending
on the value of inMem parameter. For GDAL images istGDALBased will be set.
\new48 Added in version 4.8
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Retrieves the last error generated in the object.
Gets or sets a boolean value which indicates how images with identical size and position on the map will be drawn.
When set to true such images will be merged into a single bitmap. This may improve performance
in case of low number of data pixels (those which differ from the transparent color). The default value is false.
\new48 Added in version 4.8
Returns file handle for BMP image. For inner use only.
Get or sets an instance of GeoProjection class associated with the image.
The property can't be set to NULL (there is always an instance of GeoProjection class associated with image).
\new493 Added in version 4.9.3
Returns true if image object is empty, i.e. not bound to some disk-based datasource and doesn't hold any in-memory data.
This property is the same as checking Image.SourceType = istUninitialized.
\addtogroup image_position Image position
Here is a list of methods and properties which affect position and scale of image, conversion between map units and image coordinates.
The properties and methods described here belong to Image class.
\dot
digraph image_management {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Image" URL="\ref Image"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Position" URL="\ref image_position"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Retrieves projection string from the associated .prj file.
Projection string or empty string on it's absence.
Sets projection string for the image.
The string will be saved to .prj file with the same name as image.
The projection string.
True on success and false otherwise.
Returns the extents of the image.
Gets the height of the image in pixels.
Converts coordinates of image's pixel to the screen coordinates.
The column.
The row.
The resulting x coordinate of the map.
The resulting y coordinate of the map.
\new48 Added in version 4.8
Gets or sets the number of map units per image pixel for x axis.
The changes of this value will result in scaling of the image horizontally.
\new48 Added in version 4.8
Gets or sets the number of map units per image pixel for y axis.
The changes of this value will result in scaling of the image vertically.
\new48 Added in version 4.8
Gets the height of the image.
This property should be used to return the total height of the image, as compared to the height of the image buffer.
The height of the image in pixels.
\new48 Added in version 4.8
Gets the width of the image.
This property should be used to return the total width of the image, as compared to the width of the image buffer.
The width of the image in pixels.
\new48 Added in version 4.8
Gets or sets the x coordinate of the center of lower left pixel of the image in map units.
\new48 Added in version 4.8
Gets or sets the y coordinate of the center of lower left pixel of the image in map units.
\new48 Added in version 4.8
Returns the coordinates of pixel in image buffer which correspond to the given point on the map.
X coordinate of the point in map units.
Y coordinate of the point in map units.
The resulting x coordinate of pixel in the image buffer.
The resulting y coordinate of pixel in the image buffer.
\new48 Added in version 4.8
Returns the coordinates of image pixel which correspond to the given point on the map.
X coordinate of the point in map units.
Y coordinate of the point in map units.
The column.
The row.
\new48 Added in version 4.8
Gets the width of the image in pixels.
Gets or sets the x coordinate of the center of the lower-left pixel in the image.
Gets or sets the y coordinate of the center of the lower-left pixel in the image.
Gets or sets the number of map units per pixel of image buffer for x axis.
The set part of the property is not applicable for GDAL images.
Gets or sets the number of map units per pixel of image buffer for y axis.
The set part of the property is not applicable for GDAL images.
\addtogroup image_visualization Image visualization
Here is a list of properties that affect the visualization of the image.
The properties and methods described here belong to Image class.
\dot
digraph image_visualization {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Image" URL="\ref Image"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Visualization" URL="\ref image_visualization"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Sets transparent color for image.
New transparent color.
This is shortcut to set both Image.TransparencyColor and Image.TransparencyColor2.
It also set Image.UseSetTranparencyColor to true.
\new491 Added in version 4.9.1
The interpolation mode for images which are displayed with the resolution higher than original, i.e. after zoom in (down).
Gets or sets the drawing method of image.
Was used temporarily while moving from GDI to GDI+ drawing.
\deprecated v 4.8. No longer used.
A boolean value which indicates whether an image will be displayed using a gray palette.
Gets or sets a color which is used as the transparency color for the image.
Gets or sets a second color which is used as the transparency color for the image.
All the colors between TransparencyColor and TransparencyColor2 will be transparent.
This "between" relation is calculated for each color channel and then the results are combined by AND operation.
Gets or sets the value which define alpha component of image colors (0.0-1.0).
The values range from 0.0(fully transparent) to 1.0(fully opaque).
The interpolation mode for images which are displayed with the resolution lower than original, i.e. after zooming out (up).
Gets or sets whether or not the transparency color is being used when the image is displayed.
\addtogroup image_data Data access
Here is a list of methods and properties which provide access to the values of pixels.
The properties and methods described here belong to Image class.
\dot
digraph image_data {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Image" URL="\ref Image"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Data access" URL="\ref image_data"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Gets the data from the image and puts it into the selected bitmap in the specified device context.
This function requires the width and height of the selected bitmap and the image to match.
Use of this function requires advanced knowledge in windows graphics concepts and is intended for advanced users only.
The handle to the device context.
A boolean value representing the success or failure of getting the device context handle for the image.
This function uses a bitmap selected in the specified device context handle as the data to copy into the image for which the
function is called.
This function requires the image to be the same width and height as the bitmap selected in the device context.
Use of this function requires advanced knowledge in windows graphics concepts and is intended for advanced users only.
The device context handle of the device context for which the selected bitmap is to be used to
copy the bits into the image used to call the function.
A boolean value representing success or failure of setting the image's bits using the bitmap
selected in the specified device context.
Gets a row of pixels from the image.
The row of pixels you want to get from the image.
An array which will return the pixels in the specified row of the image.
A boolean value representing the success or failure of getting the row of pixels from the image.
Returns the arrays with the unique colors of the image and their frequencies.
For large images it's recommended to perform the operation with the smaller
size of buffer to improve performance and possible RAM overuse.
The size of buffer for calculation.
The output array of unsigned integer type with unique colors.
The output array of the same size with Colors array with the frequency of the each color.
The number of unique colors.
Gets or sets the picture object.
Gets the value of a pixel in the image.
The row in the image for which the value is required.
The column in the image for which the value is required.
The value of the specified pixel in the image.
Sets the value of a pixel in the image.
The row in the image for which the value is required.
The column in the image for which the value is required.
The value of the specified pixel in the image.
Gets or sets the color scheme to render image with.
This property should be used for grid datasources in the first place (when there is no build-in colors).
But may also be used for a single band of regular RGB/ARGB images for synthetic colors and hillshading.
When no custom color scheme is set, grid rendering is chosen the color scheme from Image.ImageColorScheme will be used.
\new491 Added in version 4.9.1
Gets the value which indicates whether an image object represents a visualization proxy for another datasource.
Will return true if the image was opened with Grid.OpenAsImage only. When opened directly the link to the source grid will be lost.
\new491 Added in version 4.9.1
Returns true if the image is rendered as grid.
\new491 Added in version 4.9.1
Opens the datasource of the image as grid.
Grid object or null if the operation failed.
If the image represents a visualization proxy for grid, than the grid datasource will be opened,
otherwise the datasource of image itself.
\new491 Added in version 4.9.1
Gets the name of the source grid in case the image represent a visualization proxy for a grid.
\new490 Added in version 4.9.0
Gets or sets index of band within datasource whose values should be used to apply color scheme.
Other bands will ignored during display process. This is useful for multiband grids (e.g. NetCDF),
but may also be used with RGB images, to set synthetic colors for a single band.
\new491 Added in version 4.9.1
Indicate whether hillshade algorithm will be used for generation of image representation of the grid.
The behaviour has changed in v4.9. Now when active it only switches ColoringType from Hillshade to Gradient.
In v.4.8. it used to have the same behaviour as Image.AllowExternalColorScheme.
Sets color scheme to use in process of generation of the image representation of the grid.
The color scheme.
True on success and false otherwise.
Gets or sets the predefined color scheme for the image. Applicable for GDAL images only.
The color scheme is used for generation of image representation of the grid.
Gets grid color scheme this proxy image was generated with. The method should be called for proxy images only: Image.IsGridProxy = true.
Color scheme will be read from .mwleg XML file on the disk.
\addtogroup image_newmembers New members
Here is a list of properties and methods added in the version 4.9.4.
The properties and methods described here belong to Image class.\n\n
@{
Gets the band with the specified index.
Index of the band.
Raster band.
\new494 Added in version 4.9.4
Gets the GDAL driver which manages the current datasource.
\new494 Added in version 4.9.4
Gets the active band (the one used for rendering when grid rendering is on).
\new494 Added in version 4.9.4
Gets the palette interpretation for the image.
\new494 Added in version 4.9.4
Gets or sets the brightness of the image.
\new494 Added in version 4.9.4
Gets or sets the contrast of the image.
\new494 Added in version 4.9.4
Gets or sets the saturation of the image.
\new494 Added in version 4.9.4
Gets or sets the hue of the image.
\new494 Added in version 4.9.4
Gets or sets the gamma correction value for the image.
\new494 Added in version 4.9.4
Gets or sets the colorize intensity.
\new494 Added in version 4.9.4
Gets or sets the color of the colorize.
\new494 Added in version 4.9.4
Gets or sets the index of the red band (used when RGB rendering is chosen).
\new494 Added in version 4.9.4
Gets or sets the index of the green band (used when RGB rendering is chosen).
\new494 Added in version 4.9.4
Gets or sets the index of the blue band (used when RGB rendering is chosen).
\new494 Added in version 4.9.4
Gets or sets a value indicating whether RGB band mapping will be used.
\see RedBandIndex, GreenBandIndex, BlueBandIndex, AlphaBandIndex
\new494 Added in version 4.9.4
Gets or sets a value indicating whether the band
set by Image.ActiveBandIndex will be used rather then RGB rendering.
\new494 Added in version 4.9.4
Gets or sets the index of the alpha band.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether to use active band as an alpha band as well.
\new494 Added in version 4.9.4
Gets the minimum value for the specified band.
Index of the band.
\new494 Added in version 4.9.4
Gets the maximum value for the specified band.
Index of the band.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether colors should be reversed during gray scale rendering (i.e. the smallest values are white).
\new494 Added in version 4.9.4
Gets or sets a value indicating whether built-in color table of the image will be ignored.
\new494 Added in version 4.9.4
Gets the current rendering mode for the image (depends on the values of other properties).
\new494 Added in version 4.9.4
Gets the value of the specified pixel including the alpha component.
The row.
The column.
32bit unsigned integer value.
\new494 Added in version 4.9.4
Sets the value of the specified pixel including the alpha component.
The row.
The column.
The value to set.
\new494 Added in version 4.9.4
Gets the index of the left most pixel of the original image that was included in the current buffer.
\new494 Added in version 4.9.4
Gets the index of the top most pixel of the original image that was included in the current buffer.
\new494 Added in version 4.9.4
Gets the active color scheme used for the rendering, it may be either default or custom one.
\new494 Added in version 4.9.4
Clears the overviews for the datasource.
\new494 Added in version 4.9.4
Sets the band minimum maximum values for the band. Values outside of this range will not be rendered.
Index of the band.
The minimum.
The maximum.
True on success.
\new494 Added in version 4.9.4
Calculates the minimum and maximum values for the specified band and caches them for further use.
Index of the band.
True on success.
\new494 Added in version 4.9.4
Gets or sets the horizontal and vertical alignment of labels.
Restores the state of the object from the string.
A string generated by LabelCategory.Serialize() method.
Gets or sets the value which indicates whether the category will be used in the process of shapefile drawing.
Gets or sets expression which defines shapes that belong to this category.
Gets or sets a boolean value which indicates whether font is bold.
Gets or sets font color of labels.
Gets or sets the second font color
Gets or sets the gradient for the font of labels.
Gets or sets a boolean value which indicates whether font is italic.
Gets or sets font name to draw labels with.
The names of fonts or font families like "Arial" should be passed.
Gets or sets the outline color of the font.
\see FontOutlineVisible
Gets or sets a boolean value which indicates whether outline of the font is visible.
\see FontOutlineColor, FontOutlineWidth
Gets or sets the width in pixels of the font outline
\see FontOutlineVisible
Gets or sets the size of the font
Gets or sets a boolean value which indicates whether font is striked out.
Gets or sets the transparency of the font. Values from 0 (opaque) to 255 (transparent) are accepted.
Gets or sets a boolean value which indicates whether the font is underlined.
Gets or sets the back color of the frame.
Gets or sets the end color of the frame gradient.
\see FrameGradientMode
Gets or sets the gradient mode for the label's frame.
Use gmNone value to disable gradient.
Gets or set the outline color of the label's frame.
Gets or sets the outline color of the label's frame.
Gets or sets the width of the label's frame outline.
Gets or sets the horizontal distance from text to the border of label's frame
Gets or sets the vertical distance from text to the border of label's frame
Gets or sets the transparency of the label's frame. Values from 0 to 255 are accepted.
Gets or sets the shape of the label's frame
Gets or sets a boolean value which indicates whether label's frame will be drawn.
Gets or sets the color of the halo around the text of the label.
Gets or sets the width of the halo around the text of the label.
Gets or sets a boolean value which indicates whether a halo around text will be drawn.
Gets or sets the alignment of text within label's frame.
This property is commonly used for the alignment of multi-line labels.
Gets or sets the orientation of the label relative to the polyline it belongs to.
Gets or sets the maximum value for the specified label category in case an LabelCategory.Expression contains a range of values.
The property is used internally.
Gets or sets the minimum value for the specified label category in case an LabelCategory.Expression contains a range of values.
The property is used internally.
Gets or sets the name of the category. The names must not be unique.
Gets or sets the horizontal offset in pixels which is used to draw labels.
When labels are subject to the rotation, "horizontal" means "along text width".
\see Labels.AutoOffset property
Gets or sets the vertical offset in pixels which is used to draw labels.
When labels are subject to the rotation, "vertical" means "along text height".
\see Labels.AutoOffset property
The property isn't implemented.
Returns the state of the object in the XML-formatted string.
Use LabelCategory.Deserialize() to restore the state.
Serialized string
Gets or sets a color of shadow for the text of the label.
\see ShadowVisible, ShadowOffsetX, ShadowOffsetY
Gets or sets the horizontal distance between text of the label and its shadow.
When labels are subject to the rotation, "horizontal" means "along text width"
\see ShadowOffsetY, ShadowVisible
Gets or sets the horizontal distance between text of the label and its shadow.
When labels are subject to the rotation, "vertical" means "along text height"
\see ShadowOffsetX, ShadowVisible
Gets or sets a boolean value which indicates whether shadow of the label will be visible.
\see ShadowColor, ShadowOffsetX, ShadowOffsetY
Gets or sets a boolean value which indicates whether shapes that belongs to the category
will be visible.
Gets or sets the maximum font size fo the category.
\new494 Added in version 4.9.4
Represents a single label on the map.
\dot
digraph label_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
lb [ label="Label" URL="\ref Label"];
node [color = tan, peripheries = 1, height = 0.3, width = 1.0];
lbs [ label="Labels" URL="\ref Labels"];
edge [ dir = "none", arrowhead="open", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
lbs -> lb [ URL="\ref Labels.get_Label()", tooltip = "Labels.get_Label()", headlabel = " n"];
}
\enddot
Graph description\n\n
Multipart shapes can have separate labels for every part. Each of such labels is represented by the instance of Label class.
Labels added to the map can be accessed via Labels.get_Label() property. It's not recommended to store instances of this class
retrieved from the map after the layer they belong to was removed.\n\n
This code demonstrate how to move the label for a shape with a given index.
\code
Shapefile sf = some_shapefile;
int shapeIndex = 10; // the index of shape we want to move
// retrieving label object
Label label = sf.Labels.get_Label(shapeIndex, 0); // 0 - the first part
if (label != null)
{
// is it currently displayed on the screen?
Debug.Print("The label is drawn: " + label.IsDrawn.ToString());
label.x += 10.0; // let's move it to the right by 10 map units
label.y -= 5.0; // let's move it to the bottom by 5 map units
label.Visible = true; // ensure that it's visible
Debug.Print("The text of the label: " + label.Text);
map.Redraw(); // redraw is needed to see the changes of position
}
else {
Debug.Print(string.Format("The chart with index {0} doesn't exists", shapeIndex));
}
\endcode
\new48 Added in version 4.8
The index of visualization category the label belongs to.
The value -1 indicates that the label doesn't belong to any visualization category and
default drawing options specified in the Labels class will be used for it's drawing.
Gets a boolean value which indicates whether the label was drawn at the current extents of the map.
Gets or sets the angle of label rotation in degrees. Positive values set
clockwise rotation, negative - counter-clockwise.
Gets the extents the label occupies on the map (in pixels).
In case the label wasn't drawn on the map, NULL reference will be returned.
Gets or sets the text of the label.
Gets or sets a boolean value which indicates whether the label is visible.
Call AxMap.Redraw() to see the effect of this property.
Gets or sets the horizontal position of the label in map coordinates.
Gets or sets the vertical position of the label in map coordinates.
Represents a list of labels of the map layer and their visualization options.
\dot
digraph labels_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
lcat [ label="LabelCategory" URL="\ref LabelCategory"];
lb [ label="Label" URL="\ref Label"];
node [color = tan, peripheries = 1, height = 0.3, width = 1.0];
lbs [ label="Labels" URL="\ref Labels"];
node [style = dashed, color = gray];
sf [ label="Shapefile" URL="\ref Shapefile"];
img [ label="Image" URL="\ref Image"];
edge [ dir = "none", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
sf -> lbs [ URL="\ref Shapefile.Labels", tooltip = "Shapefile.Labels", headlabel = " 1"];
img -> lbs [ URL="\ref Image.Labels", tooltip = "Image.Labels", headlabel = " 1"];
lbs -> lcat [ URL="\ref Labels.get_Category()", tooltip = "Labels.get_Category()", headlabel = " n"];
lbs -> lb [ URL="\ref Labels.get_Label()", tooltip = "Labels.get_Label()", headlabel = " n"];
}
\enddot
Graph description\n\n
Here is a diagram with groups of API members of Labels class.
\dotfile labelsgroups.dot
Graph description
\new48 Added in version 4.8
Gets or sets the global callback object which is used for passing to the client
an information about progress and errors.
An instance of the class which implements ICallback interface should be passed.
The class should be implemented by caller.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
A text string associated with the instance of the class. Any value can be stored by developer in this property.
Marks that values of size field have changed and the size of labels should be recalculated on the next redraw.
\new494 Added in version 4.9.4
Gets or sets the maximum font size for labels (when size field is used).
\new494 Added in version 4.9.4
Gets or sets a value indicating whether variable size for labels should be used
(in the range between Labels.FontSize, Labels.FontSize2).
\new494 Added in version 4.9.4
Gets or sets a value indicating whether logarithmic scale will be used to calculate the size of labels.
\see Labels.UseVariableSize
\new494 Added in version 4.9.4
Returns the code of the last error which has occurred within the instance of class.
Gets the description of the specific error code.
The error code returned by Labels.LastErrorCode.
The string with the description.
Gets or sets the list of visualization options of labels. For inner use only.
Gets or sets the values indicating whether GDI+ library should be used to draw labels.
The default value is true. When set to false, GDI will be used for drawing.
In GDI mode no gradients and transparency is supported, while in some cases it can be somewhat faster then GDI+.
Gets a classification field used by unique values classification.
The property is used internally in couple with LabelCategory.MinValue and LabelCategory.MaxValue
to avoid the parsing of expressions for the categories in case unique values classification was applied.
Gets or sets the expression used to generate text of labels from the attribute table of the shapefile.
Applicable for the instances of Labels class associated with shapefile (obtained by Shapefile.Labels).
For labels attached to shapefile layer updates the text of each label based on Expression property.
The method is necessary when the values in underlying DBF table have changed,
since Labels class doesn't track these changes automatically.
Removes a visualization category with specified index.
The index of category to be removed.
True on successful removal and false otherwise.
Adds a visualization category for labels.
Use LabelCategory.Expression or Label.Category to map specific labels to the newly
created category.
The name of the new category
The reference to the new category.
Maps labels to the visualization categories.
LabelCategory.Expression property is analysed.
Afterwards Label.Category property is changed for all labels whose attributes comply with the expression.
Removes all the visualization categories.
Generates visualization categories for labels based on certain field from the attribute
table of the parent shapefile.
Use Labels.ApplyCategories to map particular labels to the generated categories based on the
LabelCategory.Expression property.
The index of field from the attribute table.
The type of classification.
Number of categories to be generated. It will be ignored for ctUniqueValues.
True on successful generation and false otherwise.
Inserts a new visualization category at the given position of the list.
The index to insert the new category at. Should be greater or equal to 0 and less then
Labels.numCategories.
The name of the new category.
The reference to the newly created category.
Moves a specified label category down in the list.
The index of the category to move.
True on successful operation and false otherwise.
Moves a specified label category up in the list.
The index of the category to move.
True on successful operation and false otherwise.
Number of visualization categories associated with this instance of class.
Applies color scheme to the visualization categories.
The method of interpolation.
Color scheme to take colors from.
Applies color scheme to the visualization categories.
Allows to choose the part of label to apply colors to.
The method of interpolation.
Color scheme object to borrow colors from.
The element of the label to apply colors to. Labels.ApplyColorScheme is shortcut for using leDefault option.
Applies color scheme to the visualization categories.
The method of interpolation.
Color scheme object to borrow colors from.
The element of the label to apply colors to. Labels.ApplyColorScheme is shortcut for using leDefault option.
The index of the first visualization category to apply colors to.
The index of the last visualization category to apply colors to.
\addtogroup labels_management Labels generation
Here is a list of properties and methods for adding labels (or their parts) to the map or removing them.
This module is a part of the documentation of Labels class.
\dot
digraph labels_management_graph {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Labels" URL="\ref Labels"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Managemant" URL="\ref labels_management"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Adds a new label as the last one in the list.
All the parameters passed to the method can be changed afterwards using Labels.get_Label() property.
The text of the new label.
The x coordinate of the new label.
The y coordinate of the new label.
The rotation of the label in degrees. Positive values set clockwise rotation, negative - counter-clockwise.
The index of visualization category to be used for the label drawing.
Default value is -1, which means the default drawing options will be used.
Adds a part to the label with specified index.
According to the shapefile specification shapes such as polylines or polygons can have multiple parts.
Use this method to add a separate label for each part of the parent shape.
The index of label to add a part to.
The text to be displayed.
The x coordinate of the part.
The y coordinate of the part.
The rotation of the label's part.
The index of visualization category to be used for the label drawing.
Default value is -1, which means the default drawing options will be used.
Removes all the labels and parts but not the visualization categories.
Gets the number of labels.
Each label can have more then one part.
Generates labels for each shape of the parent shapefile.
Applicable for the instances of Labels class associated with shapefile, i.e. returned
by Shapefile.Labels property.
The expression to be used for generation of the text for labels.
The method to calculate position of each label.
A value which indicates whether labels should be created for each part of the
multipart shape or for the largest part only.
The number of generated labels.
Inserts a new label at the given position.
The index to insert the label at.
The text of the label.
The x coordinate of the label.
The y coordinate of the label.
The angle of label rotation.
The index of the visualization category for the label. Use -1 if the label doesn't belong to any category.
True on success and false otherwise.
Inserts a new part for the specified label.
%Labels can have several parts which correspond to the parts of shapes they belong to.
The index of the label.
The index to insert the new part at.
The text of the label.
The x coordinate of the label.
The y coordinate of the label.
The rotation of the label in degrees.
The index of visualization category. Use -1 if the label doesn't belong to any category.
True on success or false otherwise.
Removes a label with the specified index. If the label is multipart then all its parts will be removed.
The index of the label to be removed.
True on success and false otherwise.
Removes a part of label with the specified index.
The index of the label.
The index of part to be removed.
True on success and false otherwise.
Gets or sets a boolean value which indicates whether labels should be synchronized with the parent shapefile.
Synchronization means that labels will be automatically added or removed simultaneously with
the corresponding operation in the shapefile.
Labels can be synchronized only if their number is equal to the number of shapes.
\see Labels.Count, Shapefile.NumShapes
Gets label with the specified index.
The index of label to return.
The part of the label to return. In case of single part labels 0 should be used.
A reference to the label or null reference in case of incorrect index.
Gets the number of parts for the label with specified index.
The index of the label.
The number of parts or -1 in case of incorrect index
\addtogroup labels_positioning Labels positioning
Here is a list of properties and methods which affects alignment, positioning and scale of labels. This module is a part of the documentation of Labels class.
\dot
digraph labels_positioning {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Labels" URL="\ref Labels"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Positioning" URL="\ref labels_positioning"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Map scale for which the size of labels will be equal to value set in Labels.FontSize property.
Applicable only when Label.Scale is set to true.
Gets or sets the value which indicates whether the labels will change their size depending upon map scale. The default value is false.
\see Labels.BasicScale
Gets or sets the value which affects the sequence of labels drawing relative to the map layers.
See details in the description of tkVerticalPosition enumeration.
Returns the indices of all labels which are displayed in the given part of the map.
This property doesn't change appearance of the labels.
The bounding box in screen coordinates.
The selection tolerance.
The selection mode.
An output array with indices of the labels.
An output array with indices of parts for each label.
True in case at least one label fell into selection.
Gets or sets the method of label positioning.
Gets or sets the type of the label's orientation relative to the direction of the labelled shape.
Applicable for the instance of the Labels class associated with polyline shapefiles,
i.e. obtained by Shapefile.Labels property while Shapefile.ShapefileType is polyline.
Gets or sets the horizontal offset in pixels which is used to draw labels.
When labels are subject to the rotation, "horizontal" means "along the text width".
\see Labels.AutoOffset property
Gets or sets the vertical offset in pixels which is used to draw labels.
When labels are subject to rotation "vertical" means "along the text height".
\see Labels.AutoOffset property
Gets or sets the value which defines an alignment of text within label's frame.
Should be used with multiline labels.
Turns on or off the auto offset behaviour.
When set to true, Labels.OffsetX and Labels.OffsetY property will be changed
automatically according to the size of symbols for parent shape points to avoid overlaps.
Applicable for point and multipoint shapefiles only.
Sets horizontal and vertical alignment of labels.
\addtogroup labels_serialization Labels serialization
Here is a list of methods and properties for serialization of labels and their persistence between the runs of application.
This module is a part of the documentation of Labels class.
\dot
digraph labels_serialization {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Labels" URL="\ref Labels"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Serialization" URL="\ref labels_serialization"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description\n\n
It's possible to serialize different types of information for labels (charts):\n
-# The drawing settings, such visualization options, order of drawing, etc. It's desirable to save them in virtually any scenario.\n\n
-# The positions of the labels (charts). It makes sense to save them to avoid the recalculation of the positions on the next loading.
It's quite relevant even for middle sized datasets if the more or less complex routine for positioning is used
(Shape.Centroid, Shape.InteriorPoint).\n\n
-# The angles rotation, text and categories for labels. This type of information requires serialization less often. The text of labels
can be easily restored by applying Labels.Expression. Unless the Label.Text property was set manually.
In the same way categories rely on LabelCategory.Expression and will be serialized among the first group of settings,
unless Label.Category property was set manually. Finally the rotation of labels which is preserved less often.
.
The first group of settings is embedded in the larger XML body, either layer or map settings. It can be saved:
- to the file (see AxMap.SaveLayerOptions, AxMap.SaveMapState);
- returned as a string (see AxMap.SerializeLayer, AxMap.SerializeMapState).
.
For data described in the 2nd and 3rd sections more options are available by Labels.SavingMode property and tkSavingMode enumeration. It can be:
- not serialized at all (modeNone);
- embedded in the layer or map settings in the same way as the first group (modeStandard);
- written to stand-alone XML file with the name [LayerName].lbl (modeXML, modeXMLOverwrite);
- written to the dbf table of the shapefile (modeDBF).
.
@{
Saves position and text of the labels to the attribute table (dbf file).
A value which indicates whether the text of labels will be saved.
A value which indicates whether the mapping between labels
and visualization categories will be saved.
True on success and false otherwise.
Saves positions and text of the labels to the attribute table (dbf file).
This method allows to specify the names of fields to save the data in.
The name of field to store x coordinate.
The name of field to store y coordinate.
The name of field to store angle.
The name of field to store text.
The name of field to store category.
A value which indicates whether the text of labels will be saved.
A value which indicates whether the mapping between labels and visualization categories will be saved.
True on success and false otherwise.
Saves the text, positions and visualization options of the labels to the XML file.
The name of the file to save the settings to.
True on successful saving and false otherwise.
Use Labels.get_ErrorMsg() to find out the reason of failure.
Gets or sets the method to save and restore the state labels.
See details in tkSavingMode enumeration.
Loads text and position of labels from the attribute table of the parent shapefile.
Applicable for the instance of the Labels class associated with polyline shapefiles,
i.e. obtained by Shapefile.Labels property
A value which indicates whether the text of the labels should be loaded.
A value which indicates whether the mapping between labels and visualization categories should be restored.
True on successful loading and false otherwise.
Loads text and position of labels from the attribute table of the parent shapefile.
The name of field which holds x values.
The name of field which holds y values.
The name of field which holds rotation angles.
The name of the field which stores text of the labels.
The name of the field which stores index of visualization category for each label.
A value which indicates whether the text of the labels should be loaded.
A value which indicates whether the mapping between labels and visualization categories should be restored.
True on successful loading and false otherwise.
Restores the state of the labels from the specified XML file.
The name of the file previously generated by Labels.SaveToXML method.
True on successful loading and false otherwise.
Saves the state of the labels.
Serialized state holds information about visualization options, categories and text expressions. \n\n
Optionally it can hold information about position and text of labels (see Labels.SavingMode property).
The default values of the properties will not be serialized.
A string with serialized state. On failure an empty string will be returned.
Restores the state of the Labels class from the string.
A string with serialized state generated by Labels.Serialize() method.
\addtogroup labels_visibility Labels visibility
Here is list of properties and methods which affect visibility of labels. This module is a part of the documentation of Labels class.
\dot
digraph labels_visibility {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Labels" URL="\ref Labels"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Visibility" URL="\ref labels_visibility"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Gets or sets the value which indicates whether the labels will be visible on the map.
Gets or sets an expression which defines what shapes should be labelled on the map.
Applicable only to the instances of the Labels class associated with shapefile, i.e.
obtained by Shapefile.Labels property.
\code
Labels lb = new Labels();
lb.VisibilityExpression = "[Area] > 100 and [population] > 100000";
\endcode
Is not implemented.
Gets or sets the value which indicates whether labels with the same text should be drawn.
When set to true only the labels with unique text will be drawn on map. The choice of label
to draw depends on their position in the list and the fact of belonging to the visualization category.
Gets or sets the maximum scale at which labels are visible on the map.
\see Labels.DynamicVisibility, AxMap.CurrentScale
Gets or sets the minimum size of the shape in pixels to be labelled at the current map scale.
Get or sets the minimum scale at which labels are visible on the map.
\see Labels.DynamicVisibility, AxMap.CurrentScale
Gets or sets the minimum zoom at which labels are visible on the map.
Gets or sets the maximum zoom at which labels are visible on the map.
Gets or sets the value which affects the collision avoidance routine.
Two labels are considered overlapping when the distance between their bounding rectangles
is less then this value.
\see Labels.AvoidCollisions
Gets or sets the value which turns the dynamic visibility on or off.
When set to true, labels will be visible only in the range of scales set by Labels.MinVisibleScale and Labels.MinVisibleScale.
Gets or sets the value which indicates whether a routine for preventing of label overlaps will be used.
When set to true overlapping labels won't be drawn.
\addtogroup labels_visualization Labels visualization
Here is the list of visualization properties for labels. This module is a part of the documentation of Labels class.\n\n
The more details on the topic in the description of the LabelCategory class. The properties listed below are used for all labels
without specific visualization category set, i.e. Label.Category == -1;
\dot
digraph labels_visualization {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Labels" URL="\ref Labels"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Visualization" URL="\ref labels_visualization"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Gets or sets the color of the label's shadow.
\see ShadowVisible
Gets or sets the horizontal offset of the label's shadow.
\see ShadowVisible
Gets or sets the vertical offset of the label's shadow.
\see ShadowVisible
Gets or sets the value which indicates whether label's shadow is visible.
Gets or sets the color of the halo around label's text.
\see Labels.HaloVisible
Gets or sets the size of the halo drawn around label's text.
\see Labels.HaloVisible
Gets or sets the value which indicates whether label's halo is visible.
Gets or sets the value which indicates whether the font of labels is bold.
Gets or sets the color of the label font.
Gets or sets the second color of the label font. It is used to set color gradient for the font.
\see Labels.FontGradientMode
Gets or sets the gradient mode for the labels.
\see Labels.FontColor2
Gets or sets the value which indicates whether the font of labels is italic.
Gets or sets the name of the font to draw labels with, e.g. Arial.
Sets the color of the font outline.
\see Labels.FontOutlineVisible
Gets or sets the value which indicates whether font outline is visible. The default value is false.
Gets or sets the width of the font outline. The default value is 1.
\see FontOutlineVisible
Gets or sets the size of the font to draw labels with.
Gets or sets the value which indicates whether the font of labels is struck out.
Gets or sets the transparency of the font. A values between 0 (transparent) to 255 (opaque) can be used.
The default value is 255. Values which fall outside the specified range will be
corrected to the closest acceptable value without reporting an error.
Gets or sets the value which indicates whether the font of labels is struck out.
Gets or sets the color of the frame's background.
Gets or sets the second color of the frame's background.
, Labels.FrameGradientMode
Gets or sets the type of gradient for the frame of the label.
For all values other than gmNone a gradient
starting from Labels.FrameBackColor and ending by Labels.FrameBackColor2 will be applied.
Gets or sets the outline color of the label's frame
Gets or sets the outline style of the label's frame.
Gets or sets the width of the outline of the label's frame.
Gets or sets the horizontal distance between the text of the label and its frame.
Gets or sets the vertical distance between the text of the label and its frame.
Gets or sets the transparency of the label's frame. A values between 0 (transparent) to 255 (opaque) can be used.
The default value is 255. Values which fall outside the specified range will be
corrected to the closest acceptable value without reporting an error.
Gets or sets the shape of the label's frame.
Gets or sets the values which indicates whether label's frame is visible.
Gets or sets rendering hint to be used during GDI+ rendering.
This property will be ignored if GlobalSettings.AutoChooseRenderingHintForLabels is set to true.
Gets or sets the formatting to be used for floating point numbers during generation of labels.
See acceptable formats in description of C printf function.
The commonly used values may be: %g (shortest representation), %.2f (two decimal points).
\new493 Added in version 4.9.3
Provides means for defining custom pattern from lines and point symbols for rendering polyline layers.
The line pattern consists of line segments which can be representing by lines of various style,
width and color or by markers. Line segments are drawn one atop of the other in the sequence defined
in the line pattern. \n\n
Here is a diagram for the LinePattern class.
\dot
digraph pattern_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
segm [ label="LineSegment" URL="\ref LineSegment"];
node [color = tan, peripheries = 1, height = 0.3, width = 1.0];
ptrn [label="LinePattern" URL="\ref LinePattern"];
node [style = dashed, color = gray];
sdo [ label="ShapeDrawingOptions" URL="\ref ShapeDrawingOptions"];
edge [ dir = "none", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
sdo -> ptrn [ URL="\ref ShapeDrawingOptions.LinePattern", tooltip = "ShapeDrawingOptions.LinePattern", headlabel = " 1"];
ptrn -> segm [ URL="\ref LinePattern.get_Line()", tooltip = "LinePattern.get_Line()", headlabel = " n"];
}
\enddot
Graph description
\new48 Added in version 4.8
Adds a line segment to the pattern.
The color of the line.
The width of the line.
The style of the line.
Adds a segment represented by point symbol (marker).
The type of the marker.
Reference to the newly added segment or NULL reference on failure.
Removes all the line segments from the pattern.
Returns the number of all segments in the pattern.
Restores the state of the line segment from the string.
A string generated by LinePattern.Serialize() method.
Draws a line pattern on the specified device context.
The method can be used to draw map legend.
The handle of the device context.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on successful drawing and false on failure.
Draws a line pattern on the specified device context.
The method can be used to draw map legend.
The handle of the device context.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on successful drawing and false on failure.
Gets or sets the global callback object which is used for passing to the client
the information about the progress of time consuming tasks and errors.
An instance of the class which implements ICallback interface should be passed.
The class should be implemented by caller.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Inserts line definition at the specified position of the pattern.
The index to insert the new line segment at.
The color of the line.
The width of the line.
The style of the line.
True on success and false otherwise.
Insert marker definition on the pattern at the specified position.
The index to insert the new segment at.
The type of marker.
True on success and false otherwise.
Gets or sets a string value associated with the instance of the class.
It can store any information provided developer.
Retrieves the numeric code of the last error that took place in the class.
The usage of this property clears the error code.
Removes a segment stored at the specified position of the pattern.
The position to remove the segment at.
True on success and false otherwise.
Saves the state of the object to the string.
A string with serialized state.
Gets or sets the transparency of the line pattern. The value ranges from 0(opaque) to 255(transparent).
The default value is 255. The setting affects the drawing of both lines and markers.
Gets the text description of the specified error code.
The numeric error code retrieved by ShapeDrawingOptions.LastErrorCode property.
The description of the error.
Gets the reference to the line segment stored at the specified position in the pattern.
The index of the segment.
The reference to the line segment or NULL reference on failure.
Changes line segment at the specified position to the new one.
The index of segment.
The reference to the new segment.
Holds information about a single line or marker in the line pattern represented by %LinePattern class.
Here is a diagram for the LineSegment class.
\dot
digraph segm_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
segm [ label="LineSegment" URL="\ref LineSegment"];
node [color = tan peripheries = 1 height = 0.3, width = 1.0];
ptrn [ label="LinePattern" URL="\ref LinePattern"];
edge [ dir = "none", arrowhead="open", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
ptrn -> segm [ URL="\ref LinePattern.get_Line()", tooltip = "Labels.get_Line()", headlabel = " n"];
}
\enddot
Graph description
\new48 Added in version 4.8
Gets or sets the color of the line or marker.
Draws a line segment on the specified device context.
The method can be used to draw map legend.
The handle of the device context.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on successful drawing and false on failure.
Draws a line segment on the specified device context.
The method can be used to draw map legend.
The handle of the device context.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on successful drawing and false on failure.
Gets or sets the style of the line.
Gets or sets the type of the line segment, either line or marker.
Gets or sets the width of the line.
Gets or sets the marker for the line segment.
Gets or sets the value which indicates whether the first marker in the line should be rotated by 180 degrees.
Gets or sets the interval between markers in pixels.
Gets or sets the offset for the marker.
The first marker will be positioned with offset from
the beginning of polyline by this value.
Gets or set the orientation of the marker symbols relative to the polyline.
Gets or sets the outline color of the marker.
Gets or sets the size of marker in pixels.
Gets the measured area (in square meters if WGS84 compatible projection is set for map and in current square map units otherwise).
Clears all measurements.
Saves the state of the class to the string
A string with the state or an empty string on failure.
\new493 Added in version 4.9.3
Restores the state of object from the string.
A string generated by Measuring.Serialize() method
True on success.
\new493 Added in version 4.9.3
Finishes measuring. The measured path won't be cleared from map immediately.
Gets value indicating whether measurement was stopped.
Gets the length of measured path (in meters if WGS84 compatible projection is set for map and in current map units otherwise).
The type of measurement, either distance or area.
Gets or sets a value indicating whether the finished path will be preserved on map
when map cursor changes to something other than cmMeasure.
Gets or sets a value indicating whether bearing of the line segments will be displayed.
\new493 Added in version 4.9.3
Gets number of points in the measured path.
Undoes entering of the last point in the path.
True on success.
Gets an area within the path polygon including an additional point (typically the current position of mouse cursor).
X coordinate of the last point (in map coordinates).
Y coordinate of the last point (in map coordinates).
Area in square meters if WGS84 compatible projection is set for map and in current square map units otherwise.
Gets coordinates of specified point in the path.
Index of a point.
X coordinate of the point in map coordinates.
Y coordinate of the point in map coordinates.
True on success.
Gets a value indicating whether calculations are performed taking into account the shape of Earth
(when map projection is defined), or on 2D plane (Euclidean geometry).
\new491 Added in version 4.9.1
Gets or sets a Callback object which handles progress and error messages.
\new493 Added in version 4.9.3
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Returns true if measured path contains at least one point.
\new493 Added in version 4.9.3
Gets or sets type of the bearing to be display for line segments.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether length of the line segments will be displayed.
\new493 Added in version 4.9.3
Gets or sets type of the length units to be displayed.
\new493 Added in version 4.9.3
Gets or sets the area units to be displayed.
\new493 Added in version 4.9.3
Gets or sets angle format to be used to display bearing.
\new493 Added in version 4.9.3
Gets or sets the number of decimal degrees to be used to display bearing.
This setting is not used when AngleFormat is set to minutes or seconds.
\new493 Added in version 4.9.3
Gets or sets the number of decimal degrees to be used to display area.
\new493 Added in version 4.9.3
Gets or sets the number of decimal degrees to be used to display length.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether vertices of the measured path will be visible.
\new493 Added in version 4.9.3
Gets or sets line color to display measured path.
\new493 Added in version 4.9.3
Gets or sets fill color for polygon display.
\new493 Added in version 4.9.3
Gets or sets fill transparency for polygon display.
\new493 Added in version 4.9.3
Gets or sets line width to display measured path.
\new493 Added in version 4.9.3
Gets or sets line style to display measured path.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether labels with indices of points will be visible near the vertices.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether accumulated length will be shown in brackets for each line segment.
\new493 Added in version 4.9.3
Gets or sets the type of user input to be used to undo the last point of the measured path.
\new493 Added in version 4.9.3
A text string associated with object. Any value can be stored by developer in this property.
\new493 Added in version 4.9.3
Gets the code of last error which took place inside this object.
\new493 Added in version 4.9.3
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
\new493 Added in version 4.9.3
A point object represents a point with x, y, Z, and M values. Shapes created by adding point objects to the shape.
Here is a diagram for the Point class.
\dot
digraph point_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
pnt [ label="Point" URL="\ref Point"];
node [color = tan peripheries = 1 height = 0.3, width = 1.0];
shp [ label="Shape" URL="\ref Shape"];
edge [ dir = "none", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
shp -> pnt [ URL="\ref Shape.get_Point()", tooltip = "Labels.get_Point()", headlabel = " n"];
}
\enddot
Graph description
Creates an exact copy of the point.
The new point.
\new48 Added in version 4.8
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v 4.9.3 %Point class doesn't define any callback or error messages.
The key may be used by the programmer to store any string data associated with the object.
\deprecated v 4.9.3 Key string is no longer stored for performance reasons and to spare RAM.
Retrieves the last error generated in the object.
\deprecated v 4.9.3 %Point class doesn't define any error messages.
Gets or sets the measure value of this point. Measures only apply to shapefiles with measure data.
Gets or sets the Z value of this point.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
\deprecated v 4.9.3 %Point class doesn't define any error messages.
Gets or sets the x value of the point.
Gets or sets the y value of the point.
Sets the X, Y, and Z values of this point.
The new X value.
The new Y value.
Optional. The new Z value. Defaults to 0.0 if not specified.
A shape object represents a geometric shape which can be added to a shapefile which is displayed in the map.
Here is a diagram for the Shape class.
\dot
digraph shape_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
pnt [ label="Point" URL="\ref Point"];
shp [ label="Shape" URL="\ref Shape"];
node [color = tan peripheries = 1 height = 0.3, width = 1.0];
sf [ label="Shapefile" URL="\ref Shapefile"];
edge [ dir = none, style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
shp -> pnt [ URL="\ref Shape.get_Point()", tooltip = "Table.get_Point()", headlabel = " n"];
sf -> shp [ URL="\ref Shapefile.get_Shape()", tooltip = "Shapefile.get_Shape", headlabel = " n"];
}
\enddot
Graph description
Calculates the area of the shape. For non-polygon shapes this property will return 0.0.
The area will always be returned in current map units.
No corrections are made to take into account the curved shape of Earth.
\new48 Added in version 4.8
Generates a shape which represents a boundary of the current shape.
The reference to the resulting shape or NULL on failure.
\new48 Added in version 4.8
Builds a buffer of the specified distance around the shape.
The buffer distance in map units.
The number of segments use to approximate a circle buffer.
The reference to the resulting shape which holds the buffer or NULL reference on failure.
\new48 Added in version 4.8
Calculates a center of the shape's bounding box.
\new48 Added in version 4.8
Calculates a centroid (center of mass) of the shape.
\new48 Added in version 4.8
Performs clipping operation with 2 shapes.
The available operation are:
- difference;
- intersection;
- symmetrical difference;
- union;
.
Note that clClip operation will yield the same result as intersection.
The second shape for the operation.
The operation to perform.
The reference to the resulting shape or NULL reference on failure.
\new48 Added in version 4.8
Creates a deep copy of this object with the same type, parts and points.
The copy of the shape.
\new48 Added in version 4.8
Tests a "contains" relation between 2 shapes.
The second shape.
True if this shape contains the second shape and false if it is not.
\new48 Added in version 4.8
Builds a convex hull around the current shape.
A new shape with convex hull of the current shape or NULL reference on failure.
\new48 Added in version 4.8
Creates a new shape of the specified type.
The type of the shape to be created.
A boolean value representing the success or failure of creating the new shape.
Initializes the Shape object and fills it with the geometry defined by the input string.
The input string should be in the
serialized string format as produced by the function Shape.SerializeToString.
The serialized string to load.
A boolean value representing the success or failure of loading the shape.
Tests a "crosses" relation between 2 shapes.
The second shape.
True if this shape crosses the second shape and false if it is not.
\new48 Added in version 4.8
Deletes a part from a shape.
The index of the part to be deleted.
A boolean value representing the success or failure of deleting the part.
Deletes a point in the shape.
The index of the point in the shape to be deleted.
A boolean value representing the success or failure of deleting the point in the shape.
Tests a "disjoint" relation between 2 shapes.
The second shape.
True if this shape is disjoint from the second shape and false if it is not.
\new48 Added in version 4.8
Calculates the distance between 2 shapes.
The second shape.
The calculated distance.
\new48 Added in version 4.8
Tests an "equals" relation between 2 shapes.
The second shape.
True if this shape is equal to the second shape and false if it is not.
\new48 Added in version 4.8
Splits multipart shape into simple shapes.
Holes of the polygon will not be considered as separate shapes. However
if a polygon holds several not nested rings they will be passed to output as individual polygons.
The array of Shape type with the resulting shapes.
The on success and false otherwise.
\new48 Added in version 4.8
Returns binary representation of the shape data.
The binary data will have the same format as disk representation of the shapefile.
The byte array with shape data.
True on success and false otherwise.
\new48 Added in version 4.8
Gets the extents of the shape.
Fixes the shape in case it is not valid.
Converts the data to GEOS geometry and builds a small buffer.
Call Shape.IsValid to find out the invalid shapes.
The fixed shape.
\new48 Added in version 4.8
Fixes the shape in case it is not valid.
The units of measure of the coordinate system.
The fixed shape.
\new494 Added in version 4.9.4
Calculates the intersection of 2 shapes.
In comparison with Shape.Clip this function returns all the results of intersection
even if they have different shape type. For example the intersection of 2 polygons can hold:
new polygons, polylines and points simultaneously.
The second shape.
The array of Shape type with the results of intersection.
True in case at least one shape is returned and false otherwise.
\new48 Added in version 4.8
Gets or sets a callback object for reporting about the errors.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Restores the state of the shape from binary representation obtained by Shape.ExportToBinary.
The byte array with the state of shape.
True on success and false otherwise.
\new48 Added in version 4.8
Inserts a part into the shape.
Parts are used to create polygons with holes. Parts with points ordered in a clockwise direction
are filled. Parts with points ordered in a counter-clockwise direction are cut out. Only clockwise parts should be used to
define the outer-most regions of a shape.
The index of the first point in the part to be inserted.
The part index desired. This value may be modified if it is not possible to use the desired part index.
A boolean value representing the success or failure of inserting the part into the shape.
Inserts the specified point object into the shape using the desired point index if possible.
The point object to be inserted into the shape.
Reference parameter. The index where the point will be placed if possible. If the desired index
cannot be used, the actual index will be returned.
A boolean value representing the success or failure of inserting the point into the shape.
Calculates the interior point of the shape. Is applicable for polygon shapes only.
The algorithm works as following:
- a line is defined which crosses the bounding box of the polygon horizontally in its center;
- the intersection of this line and polygon is calculated which can be represented by single segment or by a number of segments;
- the longest segment is then chosen and the point on it's center is returned.
\new48 Added in version 4.8
Tests an "intersects" relation between 2 shapes.
The second shape.
True if this shape intersects the second shape and false if it is not.
\new48 Added in version 4.8
Returns a boolean value which indicates whether a shape is valid.
Shapes is considered to be valid when it meets specific topological rules for particular shape type.
\new48 Added in version 4.8
Returns the string with the description of reason why shape was considered invalid.
\see Shape.IsValid.
\new48 Added in version 4.8
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Calculates the length of polyline shape.
The length will always be returned in current map units.
No corrections are made to take into account the curved shape of the Earth.
Gets the number of parts contained in the shape.
A polygon shape may have several parts. An example of this would be a
doughnut shape. The outermost perimeter would be one part, and the hole cut out of the center making up the innermost
perimeter would be the second part. The outermost perimeter would be specified by a series of points arranged in clockwise
order, meaning that this part will be filled. The innermost perimeter would be specified by a series of points arranged in
counter-clockwise order, meaning that this part will not be filled.
Tests an "overlaps" relation between 2 shapes.
The second shape.
True if this shape overlaps the second shape and false if it is not.
\new48 Added in version 4.8
Calculates the perimeter of shape. Is applicable for polygon shapes only.
The length will always be returned in current map units.
No corrections are made to take into account the curved shape of the Earth.
\new48 Added in version 4.8
Performs a test to find out whether a given point lies within the polygon.
The point to test.
True if points lies within polygon and false otherwise.
Tests the specified relation between 2 shapes.
This method works the same as individual overloads like Shape.Intersects, Shape.Overlaps, etc.
The second shape.
The relation to test.
True in case this relation is actually takes place and false if it is not.
\new48 Added in version 4.8
Changes the order of points within shape part to the opposite.
The property can be useful to to ensure proper topology for polygons.
The points of outer ring of polygon must have clockwise order, while the points of its holes
must be specified in counter-clockwise order.
The index of part to reverse the order of points.
True on success and false otherwise.
\new48 Added in version 4.8
Provides a string representing the shape's geometry.
The string will be in the serialized string format and can be reloaded with Shape.CreateFromString.
A string representing the shape geometry.
Gets or sets the type of the shape.
The shape's type must match the type of the shapefile the shape is to be added to
except for shapes of type SHP_NULLSHAPE.
Tests a "touches" relation between 2 shapes.
The second shape.
True if this shape touches the second shape and false if it is not.
\new48 Added in version 4.8
Tests a "within" relation between 2 shapes.
The second shape.
True if this shape lies within the second shape and false if it is not.
\new48 Added in version 4.8
Returns the index of the last point in the part.
The index of the part.
The index of the point.
\new48 Added in version 4.8
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Gets or sets the first point index in the specified part.
The index of the part for which the first point index is required.
The index of the first point in the specified part.
Returns part of the shape as a new shape.
The initial shape and the returned one doesn't shape any common memory.
The index of part to return.
The reference to the new shape and NULL reference on failure.
\new48 Added in version 4.8
Returns a boolean value which indicates whether points of the shape part are placed in the clockwise order.
The index of part.
True for the clockwise order, and false for counter-clockwise.
\new48 Added in version 4.8
Gets or sets the specified point in the shape.
The index of the point which is to be accessed in the shape.
The specified point in the shape.
Gets the coordinates of the specified point.
It's highly recommended to use this property rather than Shape.get_Point,
for considerable performance boost when Shapefile.FastMode is set to true.
The index of point.
The x coordinate.
The y coordinate.
True on successful retrieval and false on wrong index of point.
\new48 Added in version 4.8
Gets the number of points contained in the shape.
There is a confusion with name casing for this property.
It's actually spelled 'get_NumPoints' in the source code.
However because of the known bug in PIA generation process the property
ended up spelled 'get_numPoints' in earlier version of PIAs. After some hesitation we decided to keep it that way.
See description of the bug here: http://stackoverflow.com/questions/3179676/c-exposed-property-for-com-in-idl-is-showing-as-lower-case-all-of-a-sudden
Sets the coordinates of the specified point.
It's highly recommended to use this property rather than Shape.get_Point,
for considerable performance boost when Shapefile.FastMode is set to true.
The index of point.
The x coordinate.
The y coordinate.
True on success and false on the invalid index.
\new48 Added in version 4.8
Sets the index of the first point in part.
The index of part.
The index of point.
Replaces the point with the specified index with new one.
The index of point to replace.
The new point.
Adds a point to the shape.
The x coordinate of the point.
The y coordinate of the point.
The index of the new point.
\new490 Added in version 4.9.0
Calculates closest points of the 2 shapes
Second shape
Polyline shape with 2 points, the first one - closest point of this shape, the second one - closest point of parameter shape.
Uses GEOS implementation, works for all shape types. For any point lying within polygon the closest point between it and polygon will be the point itself.
\new491 Added in version 4.9.1
Imports shape data from WKT format.
Shape data in WKT format.
True on success and false otherwise.
\new491 Added in version 4.9.1
Imports shape data from WKT format.
String in WKT format with shape data.
\new490 Added in version 4.9.0
Creates a deep copy of shape to another instance, including points and parts.
Source shape to copy from.
True on success.
\new491 Added in version 4.9.1
Gets M value for specified point.
Index of point.
M value.
True in case there are M values for current shape type.
\new491 Added in version 4.9.1
Gets M value for specified point.
Index of point.
Z value.
True in case there are Z values for current shape type.
\new491 Added in version 4.9.1
Puts M value for specified point.
Index of point.
M value.
True on success.
\new491 Added in version 4.9.1
Puts Z value for specified point.
Index of point.
Z value.
True on success.
\new491 Added in version 4.9.1
Returns a new shape which constitutes a buffer around original one.
Buffer width (same units as shape coordinates are set with).
Number of segments to approximate curves.
True if buffer if single sided buffer is needed (works for polylines only).
Type of caps.
Type of joins.
Mitre limit.
New buffered shape on success or null on failure.
\new493 Added in version 4.9.3
Moves shape at specified offset.
X component of offset.
Y component of offset.
\new493 Added in version 4.9.3
Rotates shape around specified point.
X coordinate to rotate shape around.
Y coordinate to rotate shape around.
Angle in degrees.
\new493 Added in version 4.9.3
Splits shape with a provided polyline.
Polyline shape to split with.
An array of Shape type.
True on success.
\new493 Added in version 4.9.3
Removes all the points and parts.
\new494 Added in version 4.9.4
Gets "flattened" shape type, i.e. Z and M components will be ignored.
\new493 Added in version 4.9.3
Returns true if the shape doesn't have any points.
\new493 Added in version 4.9.3
Creates a new instance of ShapeDrawingOptions class by copying all the properties.
The reference to the new instance of the ShapeDrawingOptions class or NULL reference on failure.
Restores the state of object from the string.
A string generated by ShapeDrawingOptions.Serialize() method.
Draws a line using the stored options on specified device context.
The method can be used to draw map legend.
The handle of the device context. Can be obtained with .NET Graphics.GetHDC() method.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the drawing.
The height of the drawing.
A value which indicates whether or not vertices of the line will be drawn.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
Draws a line using the stored options on the specified device context.
The method can be used to draw map legend.
The handle of the device context.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the drawing.
The height of the drawing.
A value which indicates whether or not vertices of the line will be drawn.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
Draws a point symbol using the stored options on the specified device context.
The method can be used to draw map legend.
The handle of the device context. Can be obtained with .NET Graphics.GetHDC() method.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
Draws a point symbol using the stored options on the specified device context.
The method can be used to draw map legend.
The handle of the device context.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
Draws a rectangle using the stored options on the specified device context.
The method can be used to draw map legend.
The handle of the device context. Can be obtained with .NET Graphics.GetHDC() method.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the drawing.
The height of the drawing.
A value which indicates whether or not vertices of the rectangle will be drawn.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
Draws a rectangle using the stored options on the specified device context.
The method can be used to draw map legend.
The handle of the device context. Can be obtained with .NET Graphics.GetHDC() method.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
The width of the drawing.
The height of the drawing.
A value which indicates whether or not vertices of the rectangle will be drawn.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
Draws a shape using the stored options on the specified device context.
The method can be used to draw map legend.
The handle of the device context. Can be obtained with .NET Graphics.GetHDC() method.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
A shape to draw. Point, polyline and polygon shapes are supported.
A value which indicates whether or not vertices of the line will be drawn.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
Draws a shape using the stored options on the specified device context.
The method can be used to draw map legend.
The handle of the device context.
The x coordinate of the upper left corner of the drawing.
The y coordinate of the upper left corner of the drawing.
A shape to draw. Point, polyline and polygon shapes are supported.
A value which indicates whether or not vertices of the line will be drawn.
The width of the clipping rectangle.
The height of the clipping rectangle.
The back color of the device context the drawing is performed at.
The value should be specified to ensure correct blending when semi-transparent colors are used.
The alpha component of the back color of the device context the drawing is performed at.
Specify a value of 255 for the background color to be fully opaque, and 0 for the background to be transparent.
True on success and false otherwise.
\new495 Optional backAlpha parameter added in version 4.9.5
The graphical mode to be used to render symbology.
Gets or sets the background color of the polygon fill.
It is used for polygon shapes when hatch fill is chosen.
\see FillType
Gets or sets the value which indicates whether a background will be drawn when ShapeDrawingOptions.FillType is set to ftHatch.
Gets or sets the fill color of the shape.
The color is used for point and polygon shapes when ShapeDrawingOptions.FillType is equal to ftSimple or ftHatch,
or the gradient starting color is ShapeDrawingOptions.FillType is equal to ftGradient.
Gets or sets the end color of the gradient fill.
It is used when ShapeDrawingOptions.FillType is equal to ftGradient.
Gets or sets the the value which defines the bounds of the gradient fill.
The type of the gradient to draw polygon fill of the point symbols and polygon shapes.
\see FillType, FillColor, FillColor2.
The hatch style of the fill for point symbols and polygon shapes.
\see FillType, FillBgColor, FillBgTransparent.
Gets or sets the angle of rotation of the polygon fill in degrees.
Affects the rotation of gradient and texture fill.
\see FillType
Gets or sets the transparency of the fill. Ranges from 0 (transparent) to 255 (opaque).
The type of the polygon fill. See the enumeration for details.
Gets or sets the value which indicates whether the fill is visible.
Affects the drawing of point symbols and polygon shapes.
The name of the font to use for drawing point symbols when ShapeDrawingOptions.PointType is equal to pstCharacter.
Retrieves the numeric code of the last error that took place in the instance class.
The usage of this property clears the error code.
Gets or sets the line color of the shapes.
Affects the drawing of all shape types.
Gets or sets line pattern for rendering polyline shapefile.
Gets or sets the line style of the shapes.
Affects the drawing of all shape types.
Gets or sets the transparency of lines. Ranges from 0 (transparent) to 255 (opaque).
Gets or sets the value which indicates whether lines will be visible while drawing shapes.
This affects drawing of polylines, as well as the drawing of outline of points symbols and polygons.
Gets or sets the width of the lines to draw shapes.
Gets or sets the picture which will be used as texture brush (ShapeDrawingOptions.FillType = ftPicture)
or point symbol (ShapeDrawingOptions.PointType = ptSymbolPicture).
The property affects the drawing of point symbols and polygons.
Gets or sets the coefficient for scaling picture horizontally.
Gets or sets the coefficient for scaling picture vertically.
Get or sets the ANSI code of the text character to use as point symbol.
Gets or sets the rotation of the point symbol in degrees.
Gets or sets the type of reflection to apply to the point symbol.
This value is used when ShapeDrawingOptions.PointType is equal to ptSymbolFontCharacter or ptSymbolPicture.
\new495 Added in version 4.9.5
Gets or sets the predefined shape for the point symbol.
It is used when ShapeDrawingOptions.PointType is equal to ptSymbolStandard.
Gets or sets the number of sides for some of the predefined symbols such as regular, star or cross.
This value is used when ShapeDrawingOptions.PointType is equal to ptSymbolStandard.
Gets or sets the side ratio for some of the predefined point symbols such as regular, star and cross.
This value is used when ShapeDrawingOptions.PointType is equal to ptSymbolStandard.
Gets or sets the size of the point symbol including predefined symbols, characters and pictures.
Gets or sets the type of the point symbols.
The possible values include predefined symbols, text characters and pictures.
Saves the state of the class to the string
A string with the state or an empty string on failure.
Sets a predefined combination of properties to set the commonly used symbols.
This method changes PointType, PointShape, PointSidesCount, PointRotation and PointSidesRatio properties.
The predefined symbol to be set.
Provides a convenient way to set colors of the gradient fill.
The central color of the gradient.
The range of colors of each channel the gradient covers.
The values should be within 0-255.
Gets or sets a string associated with the instance of class. Can store any information provided by developer.
Gets or set the value which indicates whether line pattern will be used to render polyline shapefile.
This property won't be set to true unless line pattern with at least one line exists.
Gets or sets the color of vertices for the shapes.
\see VerticesVisible
Gets or sets the value which indicates whether the fill for shape vertices will be drawn.
\see VerticesVisible
Gets or sets the size of the shapes's vertices
Gets or sets the type of shape vertices.
Gets or sets the value which indicates whether vertices of the shape will be visible. The default values is false.
The visibility of point symbols for point shapefiles is not affected by this property.
Gets or sets the values which indicates whether shapes will be visible.
Gets the text description of the specified error code.
The numeric error code retrieved by ShapeDrawingOptions.LastErrorCode property.
The description of the error.
Gets or sets a value indicating whether hot spot of icons should be position at the bottom center.
When set to false the hotspot will be at the center of icon.
\new491 Added in version 4.9.1
Gets or sets type of frame to be displayed around point when ShapeDrawingOptions.PointShape is set to ptSymbolFontCharacter.
\new491 Added in version 4.9.1
Gets or sets a value indicating whether a frame will be drawn around point when ShapeDrawingOptions.PointShape is set to ptSymbolFontCharacter.
\new491 Added in version 4.9.1
Gets or sets a value indicating whether the category will be displayed only
for scale range specified by MinVisibleScale and MaxVisibleScale properties
\new493 Added in version 4.9.3
Gets or sets maximum map scale at which the category is visible
when ShapeDrawingOptions.DynamicVisibility is set to true.
\new493 Added in version 4.9.3
Gets or sets minimum map scale at which the category is visible
when ShapeDrawingOptions.DynamicVisibility is set to true.
\new493 Added in version 4.9.3
Represents a list of visualization categories which determine the appearance of the shapefile.
Provides methods for:
- managing categories: ShapefileCategories.Add, ShapefileCategories.Insert(), ShapefileCategories.Remove, ShapefileCategories.Clear();
- generation of categories based on the specified attribute: ShapefileCategories.Generate();
- mapping of categories to particular shapes: ShapefileCategories.ApplyExpressions();
- setting of common color scheme for the range of categories: ShapefileCategories.ApplyColorScheme().
- accessing particular categories: ShapefileCategories.get_Item().
Here is a diagram for the ShapefileCategories class.
\dot
digraph shapefilecategories_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
cat [ label="ShapefileCategory" URL="\ref ShapefileCategory"];
node [color = tan, peripheries = 1, height = 0.3, width = 1.0];
lst [ label="ShapefileCategories" URL="\ref ShapefileCategories"];
sdo [ label="ShapeDrawingOptions" URL="\ref ShapeDrawingOptions"];
node [style = dashed, color = gray];
sf [ label="Shapefile" URL="\ref Shapefile"];
edge [ dir = none, style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
cat -> sdo [ URL="\ref ShapefileCategory.DrawingOptions", tooltip = "ShapefileCategory.DrawingOptions", headlabel = " 1"];
lst -> cat [ URL="\ref ShapefileCategories.get_Item()", tooltip = "ShapefileCategories.get_Item()", headlabel = " n"];
sf -> lst [ URL="\ref Shapefile.Categories", tooltip = "Shapefile.Categories", headlabel = " 1"];
}
\enddot
Graph description
\new48 Added in version 4.8
Creates a new visualization category, adds it to the list and returns its reference to the caller.
It's the responsibility of the developer to map the new category to the
particular shape by either:
- specifying ShapefileCategory.Expression and calling ShapefileCategories.ApplyExpression();
- by using Shapefile.set_ShapeCategory() property;
.
The name of the new category. It must not be unique.
The reference to the newly created category or NULL reference on failure.
Creates the specified number of visualization categories and expressions for them.
The method can be useful to override generation routine provided in ShapefileCategories.GenerateCategories()
which always generate categories covering the full range of values of the specified field. This method can
define the range of values explicitly, therefore certain values can be excluded from classification or on contrary
categories can be added for the values which aren't yet present in the table.
The index of the field to build classification by.
The type of the classification.
The number of categories to add. If ClassificationType equals ctUniqueValues this value will be skipped.
The minimal value of the field to include in the classification.
Th maximum value of the field to include in the classification.
True on successful adding and false otherwise.
Applies color scheme to the visualization categories.
The method of interpolation.
Color scheme to take colors from.
Applies color scheme to the visualization categories.
The method of interpolation.
The color scheme to take colors from.
The element of the shape symbology to apply colors to.
Applies color scheme to the visualization categories.
The method of interpolation.
The color scheme to take colors from.
The element of the shape symbology to apply colors to.
The index of the first category to apply colors to.
The index of the last category to apply colors to.
Maps particular shapes to the category based on ShapefileCategory.Expression.
The mapping between the category and shapes can be changed by Shapefile.set_ShapeCategory property.
The index of the category.
Maps shapes to the visualization categories based in ShapefileCategory.Expression.
The mapping between the category and shapes can be changed by Shapefile.set_ShapeCategory property.
The name of the classification scheme to display in the legend.
Removes all the categories from the list.
Returns the number of the categories in the list.
Restores the state of the object from the string.
A string generated by ShapefileCategories.Serialize() method.
Generates visualization categories by certain attribute
The index of the field to generate categories by.
The type of classification.
Number of classes to generate. The parameter is omitted
in case unique values classification is used.
True on successful generation and false otherwise.
Gets or sets the callback object which is used to return to the client the information about progress and errors.
An instance of the class which implements ICallback interface should be passed.
The class must be implemented by caller.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Creates a new visualization category and inserts it at specified position of the list.
The index to insert category at.
The name of the new category.
Reference to the new category or NULL reference on failure.
A text string associated with the instance of the class. Any value can be stored by developer in this property.
Inserts a category at the specified index in the collection.
The index.
The category to be inserted.
True on success.
\new494 Added in version 4.9.4
Retrieves the numeric code of the last error that took place in the class.
The usage of this property clears the error code.
Moves the specified category down the list by swapping it with the succeeding category.
The index of the category to move down.
True on success and false otherwise.
Moves the specified category up the list by swapping it with the preceding category.
The index of the category to move.
True on success and false otherwise.
Removes the specified category.
The index of the category to remove.
True on success and false otherwise.
Saves the state of the object to the string.
A string with serialized state.
A reference to the parent shapefile.
NULL reference will be returned in case the categories aren't associated with a shapefile.
Gets the description of the specific error code.
The error code returned by ShapefileCategories.LastErrorCode
The string with the description
Returns the category with the specified index.
The index of the category to retrieve.
The reference to the category or NULL reference on failure.
Replaces the category with the specified index with the new one.
The index of the category to replace.
The new category.
Gets index of the specified category within a collection.
Category to find index for.
Index of category.
\new491 Added in version 4.9.1
Gets index of category by its name. The comparison is case-sensitive.
Category name to find index for.
Index of category.
\new491 Added in version 4.9.1
Applies specific coloring to polygon layer based on 2 rules:
- each polygon fill color must be different from the colors of all adjacent polygons;
- the minimum overall number of colors must be used.
Color scheme to take colors from. If the number of color breaks
is smaller than the number of polygon colors, interpolation with ColorScheme.GetGraduatedColor
method will be used.
The coloring assumptions used by the method correspond to the formulation of
Four color theorem. But simple greedy
algorithm used by the method usually employs somewhat more colors (5-6),
although provides much better performance than precise implementations.
True on success.
\new492 Added in version 4.9.2
Generates categories based on specified field.
Name of the field.
Type of the classification.
The number classes.
True on success.
\new494 Added in version 4.9.4
Adds the category to the collection.
The category.
\new494 Added in version 4.9.4
Gets or sets the index of classification that was used to generate categories.
\new493 Added in version 4.9.3
Represents a set of visualization options for shapefile layer.
The set of options is represented by instance of ShapeDrawingOptions class which can be accessed by ShapefileCategory.DrawingOptions,
while ShapefileCategory.Expression is used for mapping this options to particular shapes.
Here is a diagram for the ShapefileCategory class.
\dot
digraph shapefilecategory_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.2, width = 0.8];
cat [ label="ShapefileCategory" URL="\ref ShapefileCategory"];
node [color = tan, peripheries = 1, height = 0.3, width = 1.0];
sdo [ label="ShapeDrawingOptions" URL="\ref ShapeDrawingOptions"];
node [style = dashed, color = gray];
lst [ label="ShapefileCategories" URL="\ref ShapefileCategories"];
edge [ dir = none, style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
cat -> sdo [ URL="\ref ShapefileCategory.DrawingOptions", tooltip = "ShapefileCategory.DrawingOptions", headlabel = " 1"];
lst -> cat [ URL="\ref ShapefileCategories.get_Item()", tooltip = "ShapefileCategories.get_Item()", headlabel = " n"];
}
\enddot
Graph description
\new48 Added in version 4.8
Gets or sets visualization options associated with the category.
Gets or sets expression which defines shapes which belong to the category.
Gets or sets the name of the category. The names must not be unique.
Gets or sets maximum value of the value range the category covers.
The value is used when cvRange is set as ShapefileCategory.ValueType.
\new493 Added in version 4.9.3
Gets or sets minimum value of the value range the category covers.
The value is used when either cvSingleValue, cvRange
is set for ShapefileCategory.ValueType.
\new493 Added in version 4.9.3
Gets or sets value type for the category.
Depending on value type either ShapefileCategory.MinValue/ShapefileCategory.MaxValue properties
or ShapefileCategory.Expression are used in the calculation process. ShapefileCategories.Generate
method will set cvSingleValue for unique values classification and ctRange for any
interval classification. These values are faster to apply. However manual setting of
ShapefileCategory.Expression property will change it to cvExpression.
\new493 Added in version 4.9.3
Defines a part of shapefile color scheme and specifies how a certain region of a shapefile will be colored.
\deprecated in v. 4.8. Use ShapefileCategories, ShapefileCategory, ColorScheme classes instead.
\removed493 Removed in 4.9.3
Gets or sets the caption of the shapefile color break.
Gets or sets the color which will be used for drawing objects characterized by ShapefileColorBreak.EndValue.
Gets or sets the value which represent the end of shapefile color break.
Gets or sets the color which will be used for drawing objects characterized by ShapefileColorBreak.StartValue.
Gets or sets the value which represent the start of shapefile color break.
Gets or sets a boolean value which indicates whether the objects defined by color break will be displayed.
A shapefile color scheme defines how a shapefile will be colored.
A shapefile color scheme consists of ShapefileColorBreak objects.
\deprecated in v. 4.8. Use ShapefileCategories, ShapefileCategory, ColorScheme instead.
\removed493 Removed in 4.9.3
Adds a color break to the color scheme.
Gets or sets the index in the attribute table the color scheme is associated with.
Gets or sets callback object to return the information about the errors.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Insert a color break in the specified position of the scheme.
The position to insert color break at.
The color break to insert.
The actual position color break was inserted at.
Gets or sets text string associated with the object.
Returns the code of the last error which took place inside this instance of class.
Gets or sets the layer handle the color scheme is associated with.
Gets the number of color breaks in the color scheme.
The number of breaks.
Removes specific color break from the scheme.
The index of the break to remove.
Gets a color break from the color scheme.
The index of the break.
The color break object or NULL reference on failure.
Gets the description of the error code returned by ShapefileColorScheme.LastErrorCode.
The code of error.
The description of error.
Replaces a color break in the color scheme.
The index of color break to replace.
The reference to the new color break.
Represents a network built from the polyline shapefile.
A shape network is created from the shapes in a polyline shapefile which allows you to traverse the shapefile simulating
water flowing in a watershed to a single outlet. To create a shape network from a polyline shapefile, first choose an outlet
shape from the shapes in the shapefile. Next, choose an outlet point within the specified outlet shape. Finally, you need to
select a tolerance value. The tolerance is used to determine whether to include a shape in the shape network if it is not
connected to the network. Using this starting criteria, a shape network can be created from the polyline shapefile.
Builds a shape network from the specified line shapefile using the shape index to determine which shape in the shapefile is
to be used as the outlet shape.
The shapefile to be used to create the shape network.
The index of the shape in the specified shapefile to be used as the outlet shape for the shape network
The point index of the point in the specified outlet shape to be used as the outlet point for the shape network.
The tolerance used to find disconnected segments to merge into the network.
The ambiguity resolution method used to resolve any ambiguity while building the shape network.
Distance to outlet is the only ambiguity resolution method implemented.
Optional. The ICallback object which will receive progress and error messages during the
creation of the shape network.
The success or failure of building the shape network. If a non-zero integer is returned, the
shape network build was successful. If a zero is returned, the shape network build was not
successful.
Closes the shape network.
A boolean value representing the success or failure of closing the shape network.
Gets the current shape object in the shape network.
Gets the index of the current shape in the shape network.
Deletes a shape from the shape network.
The index of the shape to be deleted from the shape network.
A boolean value representing the success or failure of deleting the shape from the shape network.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Moves the current shape pointer down the network by one link.
A boolean value representing the success or failure of moving the current shape pointer down the
shape network by one link.
Moves the current shape pointer to the shape specified by the shape index.
The shape index of the shape in the network to move the current shape pointer to.
A boolean value representing the success or failure of moving the current shape pointer to the
specified shape.
Moves the current shape pointer to the outlet shape in the shape network.
A boolean value representing the success or failure of moving the current shape pointer to the
outlet shape in the shape network.
Moves the current shape pointer up the shape network, taking the specified path.
The index of the shape in the shape network to use as the upstream path. This is necessary
because a node may have more than one upstream path.
A boolean value representing the success or failure of moving the current shape pointer up in the
shape network.
Gets the number of shapes in the shape network.
Gets the number of upstream shapes in the network before the next fork.
Opens a shape network.
The shapefile object to open as a shape network.
Optional. ICallback object which will receive progress and error messages while the shape network is opened.
A boolean value representing the success or failure of opening the shape network
Gets the index of the parent of the current shape. If the current shape is the outlet shape in the shape network, -1 will be returned.
Rasterizes the network into a D8 grid.
A boolean value representing whether the shape network bounds will be used as the only
bounds for the D8 grid or not.
Optional. A grid header to use to create the new grid.
Optional. The cell size to use in creating the D8 grid.
Optional. The ICallback object which will receive progress and error messages when the grid is being created.
Optional. The rasterized Grid representing the shape network.
Gets the shapefile used to create the network.
Gets the shape index of an ambiguous shape in the shape network.
The first ambiguous shape is at index 0. If there are no ambiguous shapes,
AmbigShapeIndex(0) will return -1. If AmbigShapeIndex returns -1 and the index you specified isn't 0, it
means there are no more ambiguous shapes in the shape network.
The index into the ambiguous shapes in the shape network.
The shape index of the ambiguous shape. Returns -1 if there isn't an ambiguous shape at the
specified ambiguous shape index.
Gets the distance from the specified point in the current shape to the outlet point in the shape network.
The index of a point in the current shape.
The distance from the specified point in the current shape to the outlet point in the shape network.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Calculates the the expression taking the values from the specified row of the attribute table.
The expression to analyse.
The index of the row.
The result of calculation as variant data type, either boolean, double or string.
An output string with the description of error in case method failed.
True on successful calculation and false otherwise.
\new48 Added in version 4.8
Returns the common dialog filter containing all supported file extensions in string format.
Closes the attribute table.
The value can be ignored.
Creates a new attribute table.
A new table is automatically in editing mode after it is created.
The filename for the new table.
A boolean value representing the success or failure of creating the new table.
Sets the value of the cell.
The table must be set to allow editing before a cell's value may be edited.
The field index of the cell to be edited.
The row index of the cell to be edited.
The new value to be used to set the specified cell's value.
A boolean value representing the success or failure of setting the value of the specified cell in the table.
Deletes all rows and fields from the table. Note: The table must be set to allow editing before the rows and fields can be deleted from the table.
A boolean value representing the success or failure of deleting all rows and fields from the table.
Deletes a field from the table.
The table must be set to allow editing before a field can be deleted from the table.
The index of the field to be deleted from the table.
The ICallback object which will receive progress and error messages while the field is being deleted from the table.
Deletes a row from the table.
The table must be set to allow editing before a row can be deleted from the table.
The index of the row to be deleted from the table.
A boolean value representing the success or failure of deleting the specified row from the table.
Inserts a new field into the table.
The table must be set to allow editing before a field can be inserted into the table.
The new field to be inserted into the table.
The desired index to be used for the new field being inserted into the table.
If the desired index is invalid or unavailable, the actual index used for the new field will be returned.
The ICallback object which will receive progress and error messages while the new field is being inserted into the table.
A boolean value representing the success or failure of inserting the new field into the table.
Inserts a new row into the table.
The table must be set to allow editing before a row can be inserted into the table.
The desired index to use when inserting the new row into the table. If the
desired index is invalid or unavailable, the actual index used to insert the new row will be returned.
A boolean value representing the success or failure of inserting the new row into the table.
Replaces the specified field in the table with the new field.
The table must be set to allow editing before a field can be replaced in the table.
The index of the field to be replaced.
The field to be used to replace the specified field in the table.
The ICallback object which will receive progress and error messages while the specified field
is being replced by the new field.
A boolean value representing the success or failure of replacing the specified field.
Gets whether or not the table is in editing mode.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Gets the number of fields in the table.
Gets the number of rows in the table.
Opens a .dbf table from file.
The filename of the table to be opened.
The ICallback object which will receive progress and error messages while the table is being opened.
The boolean value representing success or failure of the opening table.
Checks if the expression is a valid one.
The expression to analyse.
An output string with the description of error in case expression is not valid.
True if expression is valid and false otherwise.
\new48 Added in version 4.8
Selects the rows in the table which agree with the specified expression.
The query expression.
An array of integer type with the indices of rows which were selected.
An output string with the description of error on failure.
True in case at least one row was selected and false otherwise.
\new48 Added in version 4.8
Saves in-memory version of the table to the source file.
This method should be called while the table is in editing mode. The editing mode will not be closed.
A callback object to report information about progress and errors.
True on success and false otherwise.
\new48 Added in version 4.8
Saves the table using the specified filename.
The filename to be used to save the table.
The ICallback object which will receive progress and error messages while the table is being saved.
A boolean value representing the success or failure of saving the table.
Sets the table to allow table editing.
Optional. The ICallback object which will receive progress and error events while the table is being
set to allow editing.
A boolean value representing the success or failure of setting the table to allow editing.
Sets the table to prevent editing.
Optional. A boolean value representing whether or not to save changes to the table. The default
is True, to save the changes.
Optional. The ICallback object which will receive progress and error messages while the table is being set to prevent editing.
A boolean value representing the success or failure of setting the table to prevent editing.
Tests the validity of expression and determines its return type.
The expression to test.
An output value with the return type, either double, string or boolean.
An output string with the description of error.
True if the expression is valid and false otherwise.
\new48 Added in version 4.8
Gets the value of the specified cell in the table.
The field index of the cell for which the value is required.
The row index of the cell for which the value is required.
The value of the specified cell in the table.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Gets the field object at the specified field index in the table.
The index of the field in the table to be returned.
The field object specified by the field index.
Seeks field with specified name. Comparison is case insensitive.
The name of field to search.
The index of field if it exists and -1 otherwise.
Returns the maximum value for the specified field of the table.
NULL will be returned in case of invalid index.
The index of the field.
The maximum value, either integer, double or string data type.
\new48 Added in version 4.8
Calculates the mean value for the specified field of the table.
NULL will be returned in case of invalid index.
The index of the field.
The mean value, either integer, double or string data type.
\new48 Added in version 4.8
Returns the minimum value for the specified field.
NULL will be returned in case of invalid index.
The index of the field.
The minimum value, either integer, double or string data type.
\new48 Added in version 4.8
Calculates the standard deviation for the set of values in specified field.
NULL will be returned in case of invalid index.
The index of the field.
The minimum value, either integer, double or string data type.
\new48 Added in version 4.8
Adds a field to the table. The table must be in editing mode.
The name of field.
The type of field.
The precision of field.
The width of field.
The index of the new field or -1 on failure.
\new490 Added in version 4.9.0
Restores state of joins from string.
String generated by Table.Serialize method.
\new490 Added in version 4.9.0
Writes contents of the DBF file to disk without changing the state of in-memory DBF.
Filename to write the data to.
Callback interface.
True on success and false otherwise.
The methods may be used for in-memory, when the content should be saved without switching to disk mode.
\new490 Added in version 4.9.0
Gets a value indicating whether the table has any joined tables.
\new490 Added in version 4.9.0
Joins external table to the current one.
External table.
Join field of this table.
Join filed of external table.
True on success.
If formats other than DBF are needed, in-memory dbf table should be populated first.
\new490 Added in version 4.9.0
Joins external table to the current one.
>External table.
Join field of this table.
Join filed of external table.
Filename to be opened to restore join on deserialization of table state.
Arbitrary join options to help restore join on deserialization.
True on success.
If filename specify formats other than dbf (extension is checked), Table.OnUpdateJoin event will be raised.
Client can handle this event by populating joinSource table parameter using filename, fieldList and options parameters.
\new490 Added in version 4.9.0
Joins external table to the current one.
>External table.
Join field of this table.
Join filed of external table.
Filename to be opened to restore join on deserialization of table state.
Arbitrary join options to help restore join on deserialization.
Comma separated list of fields to be displayed from external table.
True on success.
If filename specify formats other than dbf (extension is checked), Table.OnUpdateJoin event will be raised.
Client can handle this event by populating joinSource table parameter using filename, fieldList and options parameters.
\new490 Added in version 4.9.0
Gets number of joins for the table.
\new490 Added in version 4.9.0
Serializes the state of joins for table to be restored later with Table.Deserialize method.
String with serialized state.
\new490 Added in version 4.9.0
Stops all joins associated with table.
\new490 Added in version 4.9.0
Stops (removes) specific join created for the table.
Index of join to be removed.
True on success.
\new490 Added in version 4.9.0
Tries to create a join and reports number of rows to be joined for the specified join fields.
External table to join.
Join field of this table.
Join field of external table.
Number of rows in this table for which a join is found in external table.
Number of unique values from external table, joined to this table.
True on success.
The method can be used to determine, if the join fields for table are chosen correctly, i.e. their values match.
\new490 Added in version 4.9.0
Gets the value indicating whether the specified field is joined from external table.
Field index.
True if the field is brought from external table.
\new490 Added in version 4.9.0
Returns the index of join operation by which the specified field was brought in.
Field index.
The index of join.
\new490 Added in version 4.9.0
Gets filename of the external datasource used in specified join.
Index of join operation.
Filename of external datasource.
\new490 Added in version 4.9.0
Gets name of FromField in external table for specified join operation.
Index of join operation.
Name of FromField in external table.
\new490 Added in version 4.9.0
Gets name of ToField in this table for specified join operation.
Index of join operation.
Name of ToField in this table.
\new490 Added in version 4.9.0
Clears the cache (cell values already loaded in the memory).
\new494 Added in version 4.9.4
Gets string with the names of fields which were used in join operation.
Index of the join.
The string with names.
\new494 Added in version 4.9.4
Gets the filename of the DBF file if the table is bound to one.
\new494 Added in version 4.9.4
Gets the options of the join operation.
Index of the join.
The string with join options.
\new494 Added in version 4.9.4
Gets a value indicating whether the row values have been modified.
Index of the row.
True if the row is modified.
\new494 Added in version 4.9.4
Holds the list of tile providers associated with %Tiles class.
\new490 Added in version 4.9.0
Adds a custom tile provider.
Unique ID to to access this provider later on (including caching).
Arbitrary name of provider.
Url pattern for provider. The pattern may include the following varying components:
{zoom}, {x}, {y}, {switch:n1,n2,n3}. For example, the following can be used to setup OpenStreetMap
as custom provider: "https://{switch:a,b,c}.tile.openstreetmap.org/{zoom}/{x}/{y}.png".
Projection used by tile server. Projection must not necessarily match the map projection.
MapWinGIS will try to do the transformation even if projection don't match, though these may lead to
distortions and gaps between tiles.
Minimum zoom level provided by server.
Maximum zoom level provided by server.
True on success and false otherwise
Removes custom providers from the list.
True in case cached tiles, both from RAM and disk, for custom providers should be removed as well.
Gets the number of providers in the list.
Removes specified custom provider from the list.
Id of provider to be removed.
True in case cached tiles should be removed as well.
True if specified provider was removed, and false otherwise.
It's not allowed to remove default providers.
Gets provider ID by its index in the list.
The index of provider in the list.
ID of the provider.
For default providers the index in the list and ID are the same. For custom providers any
unique ID can be specified on creation, which may not match the index in the list.
Gets the index of default provider in the list.
Provider to find index for.
The index of provider in the list.
Gets the index of provider in the list by its ID.
Id of the provider.
The index of provider in the list.
Gets a value indicating whether given provider is a custom one.
Index of provider in the list.
True if provider is custom, false if it is a default one.
Gets name of the specific provider.
Index of the provider in the list.
Name of the provider.
Sets name of the specific providers.
Index of the provider in the list.
New name of the provider.
Providers are cached by ID therefore renaming of provider won't affect its cache.
Gets server projection for specified provider.
Index of the provider in the list.
Server projection.
Get a version string for specified provider.
Index of the provider in the list.
Version string.
Many tile servers include version as a parameter of HTTP request.
Tiles may not load if the obsolete version is passed.
Sets a version string for specified provider.
Index of the provider in the list.
Version string.
Gets maximum zoom level provided by tile server.
Index of the provider in the list.
Maximum zoom.
Zoom level is hardcoded for default providers and passed as a parameter
on creation for custom providers. Server isn't queried to check whether the values are correct.
Gets minimum zoom level provided by tile server.
Index of the provider in the list.
Minimum zoom.
Gets URL pattern for custom provider.
Index of the provider in the list.
URL pattern for custom providers and empty string for default ones.
Gets or sets a Callback object which handles progress and error messages.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Gets the code of last error which took place inside this object.
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Gets language settings for a given provider.
Index of provider in list.
The setting will be included in http request and if supported by tile provider
it may actually change language information is displayed on map with.
Language settings, e.g. "en", "fr", "ru", etc. "en" is used by default.
\new491 Added in version 4.9.1
Sets language settings for a given provider.
Index of provider in list.
Language settings, e.g. "en", "fr", "ru", etc.
The setting will be included in http request and if supported by tile provider
it may actually change language information is displayed on map with.
\new491 Added in version 4.9.1
Gets the geographic bounds of the specified provider.
The index of the provider.
Geographic bounds in decimal degrees.
\new494 Added in version 4.9.4
Sets the geographic bounds of the specified provider.
The index.
The p value.
\new494 Added in version 4.9.4
Retrieves and applies proxy server settings (address and port) from IE settings
True on success and false otherwise
Sends HTTP request to the specified address and reports back whether there is a response.
The URL to send request to.
True if there is a connection (even if there is and error code like 404 in response) and false otherwise.
Clears cache of the specified type.
Type of cache to be cleared.
Clears cache of the specified to type for a given provider and scales.
Type of cache to be cleared.
Tile provider to be cleared. ProviderNone will clear tiles for all providers.
Minimal scale (zoom) to clear tiles for.
Maximum scale (zoom) to clear tiles for.
Gets zoom (scale) of tiles currently displayed on the map.
Tile zooms are discrete, but the scale for Map control is continuous.
Therefore in most cases tiles of particular zoom will be somewhat additionally scaled to fit the map,
i.e. their display size on map won't be equal to the original 256 pixels.
Restores the state of Tiles class from string.
Serialized string generated by Tiles.Serialize method.
Gets or sets the filename of SQLite database to cache tiles into.
Gets the bounds of specific tile in decimal degrees (for inner use/debug purposes).
Id of the provider.
Zoom level for a tile.
X coordinate of the tile within zoom level.
Y coordinate of the tile within zoom level.
Bounds in decimal degrees or null on failure.
Gets indices of tiles within specified bounds in coordinates of the given zoom level.
Bounds in decimal degrees.
Zoom level.
Id of the provider.
Extents object with tile bounds or null on failure.
Can be used at the first step of prefetching operation.
Gets or sets a value indicating whether a grid should be drawn to displayes borders of tiles (for debug purposes).
Gets or sets the maximum zoom (scale) to be cached if the automatic caching is chosen.
The setting won't affect tile prefetching.
Gets or sets the minimum zoom (scale) to be cached if the automatic caching is chosen.
The setting won't affect tile prefetching.
Caches tiles of the specified provider within specified geographic bounds
to SQLite database for further offline use.
Minimal latitude to cache within.
Maximum latitude to cache within.
Minimal longitude to cache within.
Maximum longitude to cache within.
Zoom level.
Id of the provider.
StopExecution interface implementation to stop the operation prematurely.
The number of tiles scheduled for caching.
The operation is executed asynchronously. To get the progress information use Tiles.GlobalCallback property.
The callback will returned the number of tiles already downloaded. When operation is completed, -1 will be returned.
Caches tiles of the specified provider to SQLite database for further offline use.
Minimum X index of tile to be cached (in coordinates of tile zoom level).
Maximum X index of tile to be cached (in coordinates of tile zoom level).
Minimum Y index of tile to be cached (in coordinates of tile zoom level).
Maximum Y index of tile to be cached (in coordinates of tile zoom level).
Zoom level to be cached.
Id of the provider.
StopExecution interface implementation to stop the operation prematurely.
Number of tiles scheduled for caching.
The operation is executed asynchronously. See details in Tiles.Prefetch.
Caches tiles to the specified file system folder for further offline use.
Extents to cache within in decimal degrees.
Zoom level.
Id of the provider.
Directory to save files into. Nested folders for zoom levels,
X/Y coordinates will be created automatically.
File extension to store tiles with.
StopExecution interface implementation to stop the operation prematurely.
Number of tiles scheduled for caching.
Often tiles are saved with fictitious extension, like png.tile,
to avoid their listing in the gallery of smartphones for example. Tile consuming application often may be configured
to handle such extensions.
The operation is executed asynchronously. See details in Tiles.Prefetch.
Gets or sets active provider to serve the tiles.
The property will return ProviderCustom for custom provider and
won't be able to set a custom provider (use Tiles.ProviderId to do it).
Gets or sets active provider to server the tiles. Ids of both default and custom providers can be specified.
Gets the name of the active provider.
Gets list of the available default and custom tile providers.
Gets proxy server settings for tiles class including IP and port, e.g. 192.168.0.1:80.
Serializes the state of the Tiles class to be restored later with Tiles.Deserialize method.
Serialized string.
Set proxy server for tiles class.
IP address of proxy.
Port to be used.
True on success and false otherwise.
Gets or sets the amount of time in milliseconds a worker thread will sleep before the next HTTP request.
In some cases rapid caching of tiles can enact certain blocking logic for the IP address by server or one of the proxies.
\new491 Added in version 4.9.1
Gets or sets a value indicating whether server requests will be made to get the tiles.
When set to false tiles will only be loaded from cache.
Gets or sets a value indicating whether the tiles will be displayed on the map.
When set to false tiles won't be requested either from server or cache.
Gets the current size of cache.
The type of cache to return size for.
The size of cache in MB.
Gets the current size of cache used for specific provider and zoom level.
The type of cache to return size for.
Provider. ProviderNone will return size for all providers.
Scale (zoom) level. -1 will return size for all zoom levels.
The size of cache in MB.
Gets the value indicating whether tiles requested from server will be automatically cached.
The type of cache to be used.
True if automatic caching is on.
Sets the value indicating whether tiles requested from server will be automatically cached.
The type of cache to be used.
True to turn automatic caching on.
Gets the maximum allowable size of cache.
The type of cache.
Maximum size in MB.
Sets the maximum allowable size of cache.
The type of cache.
Maximum size in MB.
Gets a value indicating whether specific type of cache should be used to display tiles.
The type of cache.
True if the specific type of cache can be used.
Sets a value indicating whether specific type of cache should be used to display tiles.
The type of cache.
True if the specific type of cache can be used.
Gets or sets a value indicating whether log will include all HTTP requests or only unsuccessful ones.
\new491 Added in version 4.9.1
Gets filename to write log into.
\new491 Added in version 4.9.1
Gets a value indicating whether logging of HTTP requests will be performed.
\new491 Added in version 4.9.1
Starts logging HTTP requests for tile server.
Filename to write log into. New file will be created any existing file - overwritten.
Indicate whether only unsuccessful requests should logged.
True if log was opened, and false on failure.
\new491 Added in version 4.9.1
Stops logging of HTTP requests to a file.
\new491 Added in version 4.9.1
Gets the number of unsuccessful HTTP requests during prefetching operation (Tiles.Prefetch and overloads).
\new491 Added in version 4.9.1
Gets the total number of requests carried out during prefetching operation.
\new491 Added in version 4.9.1
Clears information about prefetching errors.
\new491 Added in version 4.9.1
Gets number of tiles stored in disk cache for a given provider, zoom and region.
Id of provider.
Zoom level.
Min X index of tile.
Max X index of tile.
Min Y index of tile.
Max Y index of tile.
Number of tiles.
Gets or sets a Callback object which handles progress and error messages.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
A text string associated with object. Any value can be stored by developer in this property.
Gets the code of last error which took place inside this object.
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Gets maximum available zoom level for the current provider.
\new491 Added in version 4.9.1
Gets minimum available zoom level for the current provider.
\new491 Added in version 4.9.1
Get information about whether map projection and tile projection match.
This diagnostic value indicates whether tiles will be rendered without scaling and distortions and if they will be rendered at all.
\new491 Added in version 4.9.1
Gets projection used by specific tile service.
\new491 Added in version 4.9.1
Clears user name and password set by Tiles.SetProxyAuthorization method.
\new493 Added in version 4.9.3
Sets credentials for proxy authorization.
HTTP client will use this credentials when 401 or 407 response is received for original request:
http://msdn.microsoft.com/en-us/library/7shxzbwb%28v=vs.80%29.aspx
Username.
Password.
Domain name.
True on success.
\new493 Added in version 4.9.3
Represents a triangulated irregular network which may be displayed in the map.
A tin may be created from a grid, or opened from file.
The string for common open dialog for filtering files which may be used as a source for TIN (*.tin).
Closes the TIN.
A boolean value representing the success or failure of closing the TIN.
Creates a new TIN object from the specified grid.
The grid to be used to create the new TIN.
If the distance between the grid elevation and the triangle surface elevation at any given
point is greater than this value, the triangle will be split at this location. This value is in projected map coordinates.
The method to use when splitting triangles.
Split Test Parameter. This value depends on the SplitMethod specified. It will either be the
smallest inscribed radius allowed measured in projected map coordinates, or it will be the /// smallest angle allowed measured in degrees.
This is the number of dividers used to create an initial mesh for the algorithm. Each cell in
the initial mesh is subdivided into smaller triangles depending on the deviation within the cell.
Optional. The maximum number of triangles allowed in the TIN. The default value is 1073741824.
Optional. The ICallback object which will receive progress and error messages while the TIN is being created.
A boolean value representing the success or failure of creating the new TIN.
Creates a TIN from the array of points.
An array of Point type.
True on success and false otherwise.
The filename associated with the object.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
The key may be used by the programmer to store any string data associated with the object.
Gets the maximum x, y, and z values of the TIN's extents.
Returns the maximum x value of the TIN's extents.
Returns the maximum y value of the TIN's extents.
Returns the maximum Z value of the TIN's extents.
Gets the minimum x, y, and z values of the TIN's extents.
Returns the minimum x value of the TIN's extents.
Returns the minimum y value of the TIN's extents
Returns the minimum Z value of the TIN's extents.
Returns the number of the triangles in the TIN.
Returns the number of the vertices in the TIN.
Opens a TIN from the specified file.
The filename of the TIN to be opened.
.Optional. The ICallback object which will receive progress and error messages while the TIN is being opened.
A boolean value representing the success or failure of opening the TIN.
Saves the TIN object under the specified filename.
The filename to be used to save the TIN.
Optional. The ICallback object which will receive progress and error messages while the TIN is being saved.
A boolean value representing the success or failure of saving the TIN.
Checks if there is a triangle in the TIN at the specified x and y coordinate.
The index of any triangle at that location is returned through TriangleHint,
and the z coordinate for the triangle surface at the specified location is returned through Z.
The index of the triangle to start the search with. If the triangle hint is a
good guess, the search can be much faster.
The x projected map coordinate of the point that is being used to test if it lies within a TIN triangle.
The y projected map coordinate of the point that is being used to test if it lies within a TIN triangle.
The z projected map coordinate of the selected triangle's surface will be returned by this parameter.
Gets the vertex indices of the specified triangle in the TIN.
The index of the triangle in the TIN for which the vertex indices are required.
The index of the first vertex in the specified triangle in the TIN.
The index of the second vertex in the specified triangle in the TIN.
The index of the third vertex in the specified triangle in the TIN.
Gets the indices of the specified triangle's neighboring triangles in the TIN.
The index of the triangle to get the neighbors of in the TIN.
The index of the first neighbor the specified triangle.
The index of the second neighbor the specified triangle.
The index of the third neighbor the specified triangle.
Gets the x, y, and Z projected map coordinates of the specified vertex in the TIN.
The index of the vertex for which the x, y, and Z coordinates are required.
Returns the x projected map coordinate of the specified vertex in the TIN.
Returns the x projected map coordinate of the specified vertex in the TIN.
Returns the x projected map coordinate of the specified vertex in the TIN.
Retrieves the error message associated with the specified error code.
Gets whether or not a triangle is a no-data triangle.
The index of the triangle to be tested whether or not it is a no-data triangle.
A boolean value representing whether or not the triangle is a no-data triangle.
Holds list of actions performed by user with interactive editing tools to enable undo functionality.
\new493 Added in version 4.9.3
Registers editing operation in undo list.
Type of undo operation (uoMoveShapes and uoRotateShapes aren't accepted here).
Layer handle the subject shape belongs to.
Index if subject shape.
True on success.
Starts batch which can hold one or more operation. UndoList.Undo and UndoList.Redo
process all operations within batch as a single entity.
True on success, and false if there is a batch was already started.
Remove all operations from undo list.
Clears all operations for particular layer from undo list.
Layer handle.
Should be called when certain layer is remove from map or editing session for it is finished.
Ends batch started by UndoList.BeginBatch command.
Returns number of operation in the batch.
A text string associated with object. Any value can be stored by developer in this property.
Gets the code of last error which took place inside this object.
Number operations performed by users that were undone but can be applied once again.
Returns total number of entries in undo list.
All opeations within batch are considered a single entries.
Number of operations performed by user that can be reverted with UndoList.Undo method.
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Reapplies a single operation in the list that was previously undone.
If true, zooms to the subject shape in case it's outside the current map view.
True on success, i.e. there was at least one operation to redo.
Reverts a single operation performed by user.
If true, zooms to the subject shape in case it's outside the current map view.
True on success, i.e. there was at least one operation to undo
A utils object provides access to a set of utility functions to perform a variety of tasks on other objects such as grids, images, points, shapes, shapefiles, tins, etc.
Modifies a polygon using the specified method.
The operation to use on the subject polygon.
The first polygon to perform the specified polygon operation on.
The second polygon to perform the specified polygon operation with.
The polygon shape created using the specified polygon operation.
Returns the numeric representation for the specified color.
The return value can be used for all properties which require color specification as unsigned integer.
The name of the color.
The numeric code of the color.
\new48 Added in version 4.8
Generates a hillshade image for a raster data source.
This code was written by Matt Perry, perrygeo@gmail.com, published in Gdal-dev Digest, Vol 19, Issue 20
Note: Scale for Feet/Latlong use scale=370400, for Meters/LatLong use scale=111120 (based on the GRASS GIS algorithm
from r.shaded.relief)
The input raster data. This can be in virtually any raster data format.
The output image filename. This can be virtually any image format, the extension will determine the format.
Z Factor. Defaults to 1.
Scale Factor. Defaults to 1.
Azimuth. Defaults to 315.
Altitude. Defaults to 45.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Uses valid data in a grid to replace grid cells containing no-data values with an interpolated value.
The grid for which no-data cells will be replaced with interpolated values.
The ICallback object which will receive progress and error messages.
A boolean value representing the success or failure of replacing no-data cells in the grid with interpolated values.
Merges multiple grids into a single output grid.
An array of grid objects to be merged into one grid.
The filename to use for the new merged grid.
Optional. A boolean value representing whether to create the merged grid in RAM or on disk
Optional. The file type of the new merged grid.
Optional. The ICallback object which will receive progress and error messages while the grids are being merged.
The new merged grid.
Replaces all occurrences of a value in the grid with a new value.
The grid to replace the specified value in.
The value in the grid to be replaced with the new value.
The value to replace the old values with.
The ICallback object which will receive progress and error mesages while
the old value is being replaced with the new values in the grid.
A boolean value representing the success or failure of replacing the old value with the new value
in the grid.
Creates a new grid of the same size as the original grid, converting the values of the original grid into a different data type in
the new grid.
The original grid.
The data type to convert the original grid values to for the new grid values.
The ICallback object which will receive progress and error messages while
the original grid values are converted and copied into the new grid.
The new grid filled with the converted values of the original grid.
Creates a new shapefile from the grid. Note: It is important that the flow grid is used when there are any ambiguous parts of
the grid.
The grid to be converted to a shapefile.
Optional. The flow grid that is used to resolve any ambiguity. Without this flow grid the output
results are somewhat unpredictable.
The ICallback object which will receive progress and error messages while
the grid is being converted to the shapefile.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Merges several images in a single image.
All the input images must be of the same size.
The color marked in the input image as transparent won't be passed to the output.
An array of string type with the filenames of the images.
The name if te output file.
\include MergeImages.cs
\new48 Added in version 4.8
Partially implemented. Creates a shapefile from any vector format supported by OGR library.
The method needs testing and elaboration to handle the peculiarities of various data formats.
The name of the vector data source.
The type of the output shapefile.
The callback object to return information about progress and errors.
The reference to the resulting shapefile or NULL reference on failure.
\new48 Added in version 4.8
Gets whether or not a point lies within the specified polygon shape.
There is a faster option available when working with shapefiles: PointInShape.
The polygon shape to perform the test on.
The point to test whether or not it lies within the specified polygon shape.
A boolean value representing whether or not the point lies within the shape.
Removes colinear points from a shapefile.
A shapefile containing colinear points leads to the shapefile taking up
unnecessary space since some points in the shapefile add detail to the display of the shapes.
The shapefile to remove colinear points from.
Points will be considered colinear if the distance in between them is with in this tolerance. This
distance is measured in projected map coordinates.
The ICallback object which will receive progress and error messages while
colinear points are being removed.
A boolean value representing the success or failure of removing colinear points from the shapefile.
Reprojects a shapefile.
The input shapefile.
The source projection.
The target projection.
The copy of shapefile with new projection or NULL reference on failure.
\new48 Added in version 4.8
Merges two shapes in a shapefile to create a new shape.
The shapefile containing the two shapes to be merged to create the new shape.
The index of the first shape to be merged.
The index of the second shape to be merged.
The ICallback object which will receive progress and error messages while
the shapes are being merged.
The resulting shape.
Creates a new shapefile with z values added from an elevation grid.
The shapefile to be converted to a new shapefile with z values.
The elevation grid to get the z values from.
The ICallback object which will receive progress and error messages while
z values are being added to the shapefile.
The new shapefile containing z values obtained from the elevation grid.
This function is not implemented. Converts a shapefile to a grid.
The shapefile to be converted into a grid.
Optional. A boolean value representing whether or not the grid will have the same extents
as the shapefile. The default is True
Optional. The grid header to use to create the new grid.
If UseShapefileBounds is set to true, the extents supplied in the grid header will be ignored
when the grid is created.
Optional. The cell size of the new grid. The default cell size is 30.
Optional. Specifies that the value of each cell in the grid should be the shape index. The default value is true.
Optional. The value to use when creating the grid. This only applies when
UseShapeNumber is set to false. The default value is 1.
The grid created from the shapefile.
Creates a shapefile from a TIN object.
The TIN object to be used to create a new shapefile.
The type of the shapefile to be created.
The ICallback object which will receive progress and error messages while
shapefile is being created from the TIN.
The new shapefile created from the TIN.
Returns the area of the polygon shape. For multi-part polygons which may contain counter-clockwise holes, the area of the
holes will be subtracted from that of the surrounding clockwise portions.
The polygon shape for which the area is required.
The area of the polygon shape.
Retrieves the error message associated with the specified error code.
The error code for which the error message is required.
The error message description for the specified error code.
Gets the length of the line shape.
Gets the perimeter of the polygon shape.
The polygon shape for which the perimeter is required.
The perimeter of the polygon shape.
Converts an hBitmap to an IPictureDisp object.
A device context handle to a bitmap.
An IPictureDisp object created from the bitmap.
Converts raster data between different formats, potentially performing some operations like subsettings, resampling, and rescaling pixels in the process.
See the description of appropriate routine in GDAL Tools.
The name of the source file.
The name of the destination file.
Options of the routine.
The callback object.
True on success and false otherwise.
This program generates a vector contour file from the input raster elevation model (DEM).
See documentation here: http://www.gdal.org/gdal_contour.html
Creates a new grid from the input one in which all values outside the specified polygon are set to no data value.
Filename of input grid.
Clipping polygon.
Filename of the results grid.
True in case grid must not be clipped using polygon extents.
True on success.
\new490 Added in version 4.9.0
Creates a new grid from the input one in which all values outside the specified polygon are set to no data value.
INput grid.
Clipping polygon.
Filename of the results grid.
True in case grid must not be clipped using polygon extents.
True on success.
\new490 Added in version 4.9.0
Converts distance from one units of measuring to another.
Source units of measuring.
Target units of measuring.
The value in source units to be converted.
The value in target units.
\new490 Added in version 4.9.0
Copies no data values from one grid datasource to another.
Filename of the source.
Filename of the target.
True on success.
Datasources must have the same size, number of bands, byte data type and must both be supported by GDAL.
\new491 Added in version 4.9.1
The same as GDAL's gdaladdo.exe utility.
See documentation here: http://www.gdal.org/gdaladdo.html
\new490 Added in version 4.9.0
The same as GDAL's gdalbuildvert.exe utility.
See documentation here: http://www.gdal.org/gdalbuildvert.html
\new490 Added in version 4.9.0
The same as GDAL's gdalinfo.exe utility.
See documentation here: http://www.gdal.org/gdalinfo.html
\new490 Added in version 4.9.0
The same as GDAL's gdal_rasterize.exe utility.
See documentation here: http://www.gdal.org/gdal_rasterize.html
\new490 Added in version 4.9.0
The same as GDAL's gdalwarp.exe utility
See documentation here: http://www.gdal.org/gdalwarp.html
\new490 Added in version 4.9.0
Calculates geodesic distance between 2 points on Earth.
Latitude of the first point in decimal degrees.
Longitude of the first point in decimal degrees.
Latitude of the second point in decimal degrees.
Longitude of the second point in decimal degrees.
Geodesic distance between 2 points in meters.
\new490 Added in version 4.9.0
Calculates statistics for portion of grid that is overlapped by specified polygon.
Input grid
Grid header. Can be retrieved with Grid.Header property.
Grid extents. Can be retrieved with Grid.Extents property.
Polygon shape within borders of which the statistics will be calculated.
No data value for grid. Can be retrieved from header.
Calculated mean value.
Calculated min value.
Calculated max value
True on success.
Header, gridExtents, NodataValue parameters are added, so that these properties can be retrieved
only ones in case the function is called multiple times for each polygon in shapefile.
\new490 Added in version 4.9.0
Calculates statistics for grid cells within each polygon of the specified shapefile. Writes results to attribute table of shapefile.
Input grid.
Polygon shapefile.
A value indicating whether calculation will be made for selected polygons only.
When set to false, calculation will be made for all polygons in shapefile.
If true output fields will be overwritten (if the fields with such names already exist).
Otherwise new set of output fields will be created with numerical indices added to their names.
If true (default) the center of the pixel needs to be inside the polygon.
If set to false Intersection method is used meaning each pixel boundary that intersects with the polygon is used. Added in v4.9.4.3.
True on success.
The default names for output fields: "Mean", "Median", "Majority", "Minority", "Minimum", "Maximum",
"Range", "StD", "Sum", "MinX", "MinY", "Variety", "Count"
\new490 Added in version 4.9.0
Creates an image from the grid using the given grid color scheme.
The grid to use to create the image.
The grid color scheme to use to create an image from the grid.
The ICallback object which will receive progress and error messages while
the image is being created from the grid.
The image created from the grid.
Creates an image proxy for grid visualization.
Grid to create proxy for.
Color scheme which defines the mapping of values to colors.
The format of output image.
True in case in-memory image should be created, otherwise it will saved to the drive.
Callback interface.
Resulting image.
The filename of the resulting image (inRam = false) is set automatically: for example, grid.asc -> grid_proxy.bmp.
In case of multi-band grids an image will be created for the active band, determined from Grid.ActiveBandIndex property.
For bmp output format a world file will be written along with resulting file. For GTiff format the same values
will be embedded in the file itself.
\new491 Added in version 4.9.1
Sets all the values inside datasource, which aren't equal to no data value, to a new value.
Filename of the input datasource.
The new value set for all cells of each band which aren't equal to no data value.
True on success.
Datasource format must be supported by GDAL. Byte data type for values is expected.
\new490 Added in version 4.9.0
The same as GDAL's ogr2ogr utility.
See documentation here: http://www.gdal.org/ogr2ogr.html
\new490 Added in version 4.9.0
The same as GDAL's OGRInfo utility.
See documentation here: http://www.gdal.org/ogrinfo.html
\new490 Added in version 4.9.0
The same as GDAL's gdal_polygonize utility.
See documentation here: http://www.gdal.org/gdal_polygonize.html
\new490 Added in version 4.9.0
Displays error message for the last error that took place within object passed as parameter.
Any MapWinGIS COM class which has LastErrorCode and get_ErrorMsg properties.
The methods is alternative syntax of calling:
\code
shapefile.get_ErrorMsg(shapefile.LastErrorCode);
\endcode
Now it also can be done like:
\code
utils.ErrorMsgFromObject(shapefile);
\endcode
Error description.
\new491 Added in version 4.9.1
Initializes GeoProjection object with projection used by specific tile service.
Projection used by tile service.
GeoProjection object or null if operation failed.
\new491 Added in version 4.9.1
Gets report about COM objects that were created and released.
Indicates whether report must include information about already released objects.
String with report.
This method can be used to find memory leaking in MapWinGIS native code
(forgotten object->Release call). The most vulnerable spots are geoprocessing functions,
where thousands of Shape or Point objects may be created in a single API call.
Before calling this make sure that:
- objects are no longer referenced anywhere in your code;
- in case of .NET, that garbage collection was performed.
\note AxMap control uses several instances of COM objects (GeoProjection, Shape) as a part of normal functioning.
This doesn't amount to memory leakage.
\new492 Added in version 4.9.2
Creates a new raster dataset based on the array of input datasets and an arbitrary formula
to calculate values of output dataset.
Array of filenames.
Formula to calculate.
Name of output dataset.
GDAL format. See list here: http://www.gdal.org/formats_list.html. Not
all of them are necessarily support creation and writing operations.
No data value for output datasource.
Callback to report progress and errors.
Error description to be returned when method fails.
True on success.
Input datasets must have the same size in pixels (projection and transformation parameters
will be copied to output from first datasource, but won't be used during calculation process).
Names of datasources in formula must match their filenames without path. Additionally @@X postfix
must be added to mark index of band to be used (1-based). The following operation are supported in formula:
arithmetic (+, -, *, /, ^); comparisons
(>, <, <=, >=, <>, =) both for raster values and scalar constants.
\code
string[] names = { @"d:\Clip_L7_20000423_B2.tif", @"d:\Clip_L7_20000423_B5.tif" };
string formula = "[Clip_L7_20000423_B5.tif@1] + [Clip_L7_20000423_B2.tif@1] + 5"; // @1 = first band is used in both cases
string errorMsg;
var ut = new Utils();
bool result = ut.CalculateRaster(names, formula, @"d:\output.tif", "GTiff",
0f /* no data value */, this /*callback */, out errorMsg);
\endcode
\new492 Added in version 4.9.2
Creates a new datasource by mapping data ranges of the specified band of input datasource
to new values.
Filename of input GDAL raster datasource.
Band index of input datasource to be processed.
Filename of output datasource.
Array of double type with lower bounds of mapping ranges. These values
will be compared with values of input datasource. Must be sorted in ascending order.
Array of double type with upper bounds of mapping ranges. These values
will be compared with values of input datasource.
Array of double type with values to be set for output datasource
for each mapping range.
GDAL format. See list here: http://www.gdal.org/formats_list.html. Not
all of them are necessarily support creation and writing operations.
Callback to report progress and errors.
True on success.
All 3 input arrays must be of the same size. In case of overlapping ranges the one located first
will be used. Here is code sample with 5 data ranges using anonymous data type:
\code
var ut = new Utils();
var arr = new[]
{
new {Low = 0.0, High = 20.0, NewValue = 40.0},
new {Low = 20.0, High = 40.0, NewValue = 150.0},
new {Low = 40.0, High = 60.0, NewValue = 100.0},
new {Low = 60.0, High = 80.0, NewValue = 20.0},
new {Low = 80.0, High = 100.0, NewValue = 80.0},
};
if (!ut.ReclassifyRaster(@"d:\source.tiff", 1 /* band index */,
@"d:\output.tif",
arr.Select(i => i.Low).ToArray(),
arr.Select(i => i.High).ToArray(),
arr.Select(i => i.NewValue).ToArray(),
"GTiff", this /* callback */))
{
MessageBox.Show("Failed to reclassify: " + ut.get_ErrorMsg(ut.LastErrorCode));
}
else
{
MessageBox.Show("Reclassified successfully");
}
\endcode
\new492 Added in version 4.9.2
Returns a boolean value which indicates whether the specified file holds tiff grid.
The name of the file.
True on success and false otherwise.
\new493 Added in version 4.9.3 (is moved from AxMap.IsTiffGrid)
Gets the tkUnitsOfMeasure enumeration associated with the specified EPSG Unit Code
EPSG-defined Unit of Measure constant
The internal enumeration associated with the specified EPSG code
Supports the more common EPSG-defined Unit constants; specifically those that can be mapped to
the currently defined tkUnitsOfMeasure enumeration values. If the EPSG code cannot be mapped,
an Error will be submitted to the global callback with error code tkINVALID_PARAMETER_VALUE,
and return the default value of umDecimalDegrees.
\new495 Added in version 4.9.5
Gets the name of the projection associated with the specified NAD83 enumeration
Value from the the NAD83 projection enumeration tkNad83Projection
GDAL-provided projection name, or an empty string on error
If an error occurs, either because an invalid ID is specified, or the projection string
could not be loaded, a descriptive error will be raised to the Callback function (if one is specified).
\new495 Added in version 4.9.5
Gets the name of the projection associated with the specified WGS84 enumeration
Value from the the NAD83 projection enumeration tkNad83Projection
GDAL-provided projection name, or an empty string on error
If an error occurs, either because an invalid ID is specified, or the projection string
could not be loaded, a descriptive error will be raised to the Callback function (if one is specified).
\new495 Added in version 4.9.5
Gets the name of the projected coordinate system associated with the specified SRID,
which include the NAD83 and WGS84 codes, as well as those not specified by the enumerations,
such as NAD27, NAD83 Harn, Beijing, Pulkova, etc.
Spatial Reference identifier, could refer to any valid Projected or Geographic coordinate system
GDAL-provided name of a projected or geographic coordinate system, or an empty string on error
If an error occurs, either because an invalid ID is specified, or the projection string
could not be loaded, a descriptive error will be raised to the Callback function (if one is specified).
\new495 Added in version 4.9.5
Gets a list of ID,Name pairs of Projected and/or Geographic coordinate systems
One or a combination of values from the tkProjectionSet enumeration
Reference to an Object that will be filled with an array of strings
True if successful (list will contain an array of strings containing the ID/Name pairs associated with the specified Projection Sets), or False on failure (list will be empty)
Each string will contain one pair of values, an ID and a Name, separated by a comma (e.g. "32611,WGS 84 / UTM zone 11N").
These can be parsed and used, for example, to populate a ComboBox control for user selection of a Projection.
If an error occurs, or if the projection strings could not be loaded, a descriptive error will be raised to the Callback function (if one is specified).
\new495 Added in version 4.9.5
A vector object is used to represent the light source for a grid color scheme.
Calculates the vector cross product between the current vector object and the specified vector.
The vector to calculate the cross product with the current vector object.
The cross product of the current vector object and the specified vector.
Calculates the dot product of the current vector object with the specified vector.
The vector to use to calculate the dot product with the current vector object.
The dot product of the current vector object and the specified vector.
The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
The key may be used by the programmer to store any string data associated with the object.
Retrieves the last error generated in the object.
Normalizes the vector.
Retrieves the error message associated with the specified error code.
Gets or sets the i component of the vector.
Gets or sets the j component of the vector.
Gets or sets the k component of the vector.
Closes datasource and underlying connection.
This method should be called as soon as datasource is no longer needed.
Opens particular type of datasource supported by GDAL/OGR.
See details about connection strings here: http://www.gdal.org/ogr_formats.html
Connection string for RDMSs or filename for file-based formats.
True on success.
Opens particular type of datasource supported by GDAL/OGR.
See details about connection strings here: http://www.gdal.org/ogr_formats.html
Connection string for RDMSs or filename for file-based formats.
Indicates whether datasource will be opened with update flag.
True on success.
Gets a name of the layer with particular index.
Index of layer.
Name of layer or empty string for invalid layer index.
Gets a layer with specified name from the datasource.
In case of spatial databases layerName corresponds to name of the underlying table.
However there can be some format specifics. For example name may include schema prefix and name of geometry column
(in case there is more than one geometry column in the table).
For example, "public.buildings(geom2)" may correspond to "geom2" column of table named
"buildings" in "public" schema.\n
Resulting layer has no reference to %OgrDatasource object, which can safely closed if it is no longer needed.
Layer name (case insensitive).
Indicates whether the returned layer will support saving of changes back to source
(the functionality should be supported by particular driver).
Instance of OgrLayer or null on failure.
Runs a query against datasource and returns the result as a temporary layer.
Usually some sort of SELECT query returning a set of rows with one
or several geometry columns is expected here. Other types of SQL instructions will also be processed,
however OgrDatasource.ExecuteSQL is recommended way to do it.\n\n
Resulting layer has no reference to %OgrDatasource object, which can safely closed if it is no longer needed.\n
SQL query.
Temporary layer or null on failure.
The following code builds 0.01 degree buffer zones around waterways layer extracted from database
and displays both waterways and buffer layers on the map. st_buffer function is supported by PostGIS.
See documentation of particular spatial database for list of supported functions and their arguments.
\code
private static string CONNECTION_STRING = "PG:host=localhost dbname=london user=postgres password=1234";
private static bool TestSpatialQuery()
{
var ds = new OgrDatasource();
if (!ds.Open(CONNECTION_STRING))
{
Debug.WriteLine("Failed to establish connection: " + ds.GdalLastErrorMsg);
}
else
{
map.RemoveAllLayers();
map.Projection = tkMapProjection.PROJECTION_WGS84;
// build a buffer in a first query
string sql = "SELECT st_buffer(wkb_geometry, 0.01) AS buffer, * FROM waterways;";
var buffer = ds.RunQuery(sql);
if (buffer == null)
{
Debug.WriteLine("Failed to build buffer: " + gs.GdalLastErrorMsg);
}
else
{
Debug.WriteLine("Number of features in a buffer: " + buffer.FeatureCount);
map.AddLayer(buffer, true);
buffer.GetBuffer().DefaultDrawingOptions.FillColor = 255; // red
}
// simply extract unaltered source features in the second query and display them above the buffer
string sql2 = "SELECT * FROM waterways;";
var layer = ds.RunQuery(sql2);
if (layer == null)
{
Debug.WriteLine("Failed to open layer: " + gs.GdalLastErrorMsg);
}
else
{
Debug.WriteLine("Number of features in layer: " + layer.FeatureCount);
map.AddLayer(layer, true);
}
ds.Close();
}
return true;
}
\endcode
Deletes a layer with specified index from datasource.
Use OgrDatasource.TestCapability(tkOgrDSCapability.odcDeleteLayer) to check
whether functionality is supported by particular driver.
Layer index within datasource.
True on success.
Test whether driver of the currently opened datasource supports particular capability.
A capability to test.
True in case the capability is supported by the driver.
Returns index of layer with the specified name.
Layer name (case insensitive).
Index of layer or -1 in case it wasn't found.
Executes SQL statement against datasource.
Should be used for non-SELECT instructions which don't return resulting set of rows.
To select data use OgrDatasource.RunQuery instead.
SQL instruction.
Error message provided in case of failure.
True on success and false otherwise.
The following code deletes records from underlying database table with gid > 100.
\code
var ds = new OgrDatasource();
if (!ds.Open(CONNECTION_STRING))
{
Debug.Pring("Failed to establish connection: " + ds.GdalLastErrorMsg);
}
else
{
string errorMsg;
bool result = ds.ExecuteSQL("DELETE FROM tableName WHERE gid > 100", out errorMsg);
if (!result)
{
Debug.Pring("Error on running SQL: " + errorMsg);
}
else
{
Debug.Pring("SQL was executed successfully.");
}
ds.Close();
}
\endcode
Gets the array with schema names in the datasources.
Boxed string array.
\new494 Added in version 4.9.4
Gets the description of the specific error code.
The error code returned by LastErrorCode property.
String with the description.
Gets code of the last error which took place inside this object.
Gets or sets a Callback object which handles progress and error messages.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Gets or sets a text string associated with object. Any value can be stored by developer in this property.
Gets number of layers in the datasource.
Gets name driver (name of format) for this datasource.
Gets the number of metadata items associated with current driver.
Gets metadata item with specified index associated with current driver.
Index of metadata item to be returned.
String with metadata.
Extracts the last error message reported by GDAL library.
Defines the way to resolve ambiguity resolution for shape networks.
Defines the type of coloring for grids.
The available types of fields of dbf table.
Gradient model for grid visualization
The data type which represents a single cell of a grid.
The type of grid supported by MapWinGIS.
The type of images supported by MapWinGIS.
Available polygon operations.
Predefined color schemes which can be used for grid visualization of for initialization of instance of ColorScheme class.
The selection mode, which determines which shapes will be considered as included in the rectangular selection.
All the shapes that lie within the rectangle or do intersect it will be included.
Only the shapes that lie within the rectangle and doesn't intersect it will be included.
The type of the shapefile.
The main types are SHP_NULLSHAPE, SHP_POINT, SHP_POLYLINE, SHP_POLYGON.
SHP_MULTIPOINT is much harder to encounter. SHP_MULTIPATCH isn't supported by MapWinGIS\n
For each of the flat (2D) type there is a 2.5D representation, with either Z (holds z value) or M (holds z and m values) postfix.
See shapefile specification for details: http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf
Split methods used for creation of TIN from grid.
The available types of chart.
\new48 Added in version 4.8
Each chart field is represented by bar.
Each chart field is represented by sector.
The style of labels with numeric measures of the data for each field.
\new48 Added in version 4.8
The type of the classification available for ShapefileCategories.Generate and Labels.GenerateCategories methods.
\new48 Added in version 4.8
The position of breaks are chosen to minimize the sum of square deviations within categories.
The algorithm is heuristic, therefore gives only approximation of the real position of natural breaks.
Nevertheless it's recommended as a default classification suitable in most cases.
A category will be created for each unique value of the field.
To define the upper bound of a category the expression will be used: (IndexOfCategory + 1) * (MaxValue - MinValue) / NumberOfClasses.
The bounds of categories will be chosen in such a manner that each of them will have equal number of objects which belongs to it.
In practice this condition is rarely achieved because of the rounding problems, objects with the same values, etc.
Six categories will be created, the range of each of them will be equal to the standard deviation of the field data.
Three categories will hold values greater then mean and three - lower than it.
The sum values of the classification field will be roughly the same for all categories.
The available clipping operation for Shape.Clip method.
The clClip value will be yield the same result as clIntersection.
\new48 Added in version 4.8
Sets drawing behaviour when overlapping labels and charts are present on map.
\new48 Added in version 4.8
Overlaps of labels (charts) are allowed. The subsequent labels (charts) will be drawn atop of the prior ones, thus hiding them.
The overlapping labels (charts) on the same layer are not allowed.
The overlapping labels (charts) on different layers are allowed.
No overlapping labels (charts) are allowed for both inside the layer and across the layers.
The type of color scheme. Determines how colors will be extracted from the color scheme (see ShapefileCategories.ApplyColorScheme for example).
\new48 Added in version 4.8
The color will be chosen randomly from the available range between two color breaks.
The color will be chosen by linear interpolation from the available range between two color breaks.
The available mouse cursors provided by the system.
Available cursor modes. Determines the default respond of map to the action of user.
To define the new behaviour set the value to cmNone and handle the events provided by map controls.
The map will be zoomed in on mouse click.
The map will be zoomed out on mouse click.
The panning of the map will be performed after the dragging operation by the mouse.
Rubber band rectangular will be displayed on the dragging operation by the mouse. SelectBoxFinal event will be generated on he release of button.
The map will not respond to the user action.
Measuring of area or distance will take place. See Measuring class for details.
Allows to add shapes to vector layers (Shapefile or OgrLayer) in interactive mode.
See description of ShapeEditor class.
Allows to edit shapes of vector layers (Shapefile or OgrLayer) in interactive mode.
See description of ShapeEditor class.
Splits polylines or polygons of a single layers with interactive drawn polyline.
AxMap.ChooseLayer event must be handled to select the layer.
Fires AxMap.ShapeHighlighted and AxMap.ShapeIdentified events. Optionally visually
highlights shapes under cursor. See Identifier class for available options.
The functioning can be tested in the Demo app.
Allows to moves selected shapes of a single vector layers. AxMap.ChooseLayer event must be handled to
select the layer.
Allows to rotates selected shapes of a single vector layers. AxMap.ChooseLayer event must be handled to
select the layer.
Selects shapes of a single vector layer with interactively drawn polygon.
AxMap.ChooseLayer event must be handled to select the layer.
Erases parts of shapes shapes of a single vector that intersects with interactive drawn polygon.
AxMap.ChooseLayer event must be handled to select the layer.
Splits polygons or polylines of a single layer with interactively drawn polygon.
AxMap.ChooseLayer event must be handled to select the layer.
Removes all shapes of a selected layers which don't intersect with interactively drawn polygon.
AxMap.ChooseLayer event must be handled to select the layer.
The available style of lines. Can be used for drawing polylines and outlines of the polygons.
\new48 Added in version 4.8
The value will be ignored. The default dsSolid will be used instead.
The set of available point symbols. They represent macros for modification of several properties of the ShapeDrawingOptions class at once.
\new48 Added in version 4.8
The type of spatial reference for the drawing layer.
The objects of the drawing layer are specified in screen coordinates and are not moved after the changes of the extents.
To update such layers the full redraw is not needed. Therefore use AxMap.Refresh rather than AxMap.Redraw.
The objects of the drawing layer are specified in map coordinates. Their position changes after zooming operations.
To update such layers the full redraw is needed (AxMap.Redraw()).
Deprecated. The available types of fill stipple.
\deprecated v.4.8. Use properties which take tkGDIPlusHatchStyle enumeration as input instead.
The type of shape fill.
\see ShapeDrawingOptions.FillType
\new48 Added in version 4.8
Solid fill.
Hatched fill. See ShapeDrawingOptions.FillHatchStyle.
Gradient fill. See ShapeDrawingOptions.FillGradientType.
A texture fill. See ShapeDrawingOptions.Picture.
The resampling mode which is used for building GDAL overlays.
\see Image.BuildOverlays.
\new48 Added in version 4.8
The hatch style available for drawing of fill for polygons and point symbols.
\new48 Added in version 4.8
The list of parameters of the geographical coordinate system.
\new48 Added in version 4.8
The half of the length of the major axis of reference ellipsoid.
The half of the length of the minor axis of reference ellipsoid.
The inverse flattening for the reference ellipsoid
The prime meridian for geographic coordinate system.
The angular units for geographic coordinate system.
The possible engines (libraries) to carry out geoprocessing tasks.
\new48 Added in version 4.8
GEOS library. From version 4.8. linked statically (included in MapWinGIS).
Clipper library. Linked statically (included in MapWinGIS).
Possible size of gradient for the shapefile layer.
\new48 Added in version 4.8
A single gradient will be applied for all shapes of the shapefile.
Gradient will be applied to each shape individually.
The type of gradient for point and polygon fill.
\new48 Added in version 4.8
Linear gradient.
Rectangular gradient.
Circle gradient.
Deprecated. The available justification types for labels.
\deprecated v. 4.8. Use properties which take tkLabelAlignment enumeration as an input instead.
The source type for the image.
The image can uninitialized, to be opened by MapWinGIS native code (bmp images) or GDAL library (all other formats).
It's important to check this value as various types of images can have different behaviour and applicable methods.
\new48 Added in version 4.8
The image is not bound to particular source.
The image object will have this state before Image.Open or Image.CreateNew
commands or after Image.Close command.
The image is bound to bmp file on disk.
No third-party libraries are used for it's processing. The editing of values is saved to the disk immediately.
The necessary part of image is read from the disk before each redraw, but this data isn't preserved in RAM after the drawing is finished.
The source of the image is the array of pixels stored in the RAM.
It's possible to edit these values and save them to a file afterwards.
The image is opened through GDAL library.
Only a part of the image (a "buffer") is loaded into memory before each redraw and remains there till
the next redraw. The editing of the pixels of he buffer is allowed but the changes will be discarded on the next redraw of the map.
This value is set for the point icons stored in the ShapeDrawingOptions.Picture property after the deserialization of the
object state from string.
The interpolation mode which can be use when image is drawn with the resolution higher or lower than original.
\new48 Added in version 4.8
The available alignments for the labels. Defines both horizontal and vertical alignment.
\new48 Added in version 4.8
Lists the parts of the label. Can be used to specify particular parts to apply color scheme to.
\new48 Added in version 4.8
If the frame is visible the color scheme will be applied to it. Otherwise it will interpreted as font color.
The the available shapes of the frames for labels, i.e. rectangles drawn around the labels to ensure better contrast.
\new48 Added in version 4.8
The available positioning of the label relative to the parent shape.
Each constant is applicable to the specific shape type only, otherwise the operation will generate an error.
This constants doesn't affect the positioning of label for point and multipoint shapefile. So any value can be passed in that case.
\new48 Added in version 4.8
The label will be placed in the center of bounding box. Applicable to polygons only.
The label will be placed in the centroid of the shape. Applicable to polygons only.
The label will be placed in the interior point (see Shape.InteriorPoint for details). Applicable for polygons only.
The label will be placed in the beginning of the first segment of the polyline. Applicable to polylines only.
The label will be placed in the end of the last segment of the polyline. Applicable to polylines only.
The label will be placed in the center of the middle segment of the polyline. Applicable to polylines only.
The middle segment is the one which contains a point which splits the polyline into 2 parts of equal length.
The label will be placed in the center of the longest segment of the polyline. Applicable to polylines only.
Is used internally.
The available gradient mode for drawing background of label and for its font.
\new48 Added in version 4.8
Defines the orientation of label relative to the line it marks.
\new48 Added in version 4.8
Deprecated. The available line styles.
\deprecated v.4.8 Use properties which take tkDashStyle enumeration as input instead. For drawing complex lines use LinePattern class.
The available type of segments in the LinePattern.
\new48 Added in version 4.8
The segment is represented by common line with styles defined by tkDashStyle enumeration.
The segment is represented by the markers placed in organized order through specific interval.
The lock mode of the map, either locked or not.
A list of named constants for some of the well-known colors.
Use Utils.ColorByName to pass this values to particular properties.
\new48 Added in version 4.8
The available types of shapes for points when ShapeDrawingOptions.PointType is set to ptSymbolStandard.
The appearance of regular, cross and star shapes can be modified by
ShapeDrawingOptions.PointSidesCount, and ShapeDrawingOptions.PointSidesRatio properties.
\new48 Added in version 4.8
Regular shapes.
Consist of a number of segments of equal length, equally distanced from the center and forming a closed contour.
For example, equilateral triangle, square, pentagon, etc.
Cross-like shapes.
Consists of the number of segments with varying direction which start in the center of shape.
The direction is changed by a constant step chosen in such way as to cover the whole circle.
Star like shape.
Represents stars with different number of rays.
Circle shape.
Arrow shape.
Flag shape.
The available types of point symbols.
\new48 Added in version 4.8
The shape described by tkPointShapeType enumeration can be drawn.
The ANSI font characters can be drawn.
\see ShapeDrawingOptions.PointCharacter.
Icons represented by instance of the image class can be drawn.
\see ShapeDrawingOptions.Picture property.
Deprecated. The available point types.
\deprecated v4.8. Use properties which take tkDefaultPointSymbol enumeration as input instead.
Available options applicable to point reflection
\new495 Added in version 4.9.5
No reflection is applied
Symbol is flipped left-to-right
Symbol is flipped top-to-bottom
The available parameters for the projections.
\new48 Added in version 4.8
List the behaviours the control will use to adjust its contents after the resizing operation.
The extents of the map will be kept untouched.
This may cause distortions if the scaling factors by x and y axis aren't the same.
The scale of he map will be preserved.
The possible behaviours that affect the serialization and deserialization of labels (charts).
See \ref labels_serialization "Serialization of labels" for additional information.
\new48 Added in version 4.8
Only the visualization settings of the labels (charts) will be serialized. The existing labels and charts won't be cleared on deserialization.
The settings as well as positions of the labels (charts) will be serialized.
The existing labels and charts will be cleared on deserialization.
The settings of labels (charts) will be serialized in the large XML body, while positions will be serialized to the stand-alone .lbl file.
The settings of labels (charts) will serialized in the large XML body, while positions will be serialized to the standard fields of dbf table.
The same as modeXML but .lbl file will be overwritten (in case it exists).
Defines the possible ways to display the selected shapes of the shapefile.
\new48 Added in version 4.8
The shapes will be highlighted by Shapefile.SelectionColor with Shapefile.SelectionTransparency setting.
This value is a default one.
The drawing options defined by Shapefile.SelectionDrawingOptions property will be used.
Possible values that were used to setup certain aspects of drawing routines.
\new48 Added in version 4.8
\deprecated v4.8. The default value dmNewSymbology must be used in all cases.
The drawing routine for 4.7 and prior versions, without shapefile categories, polygon gradients, built-in selection, etc.
The intermediate implementation between 4.7 and 4.8.
The intermediate implementation between 4.7 and 4.8.
The default drawing routine for version 4.8. Uses all the latest functionality of the control.
The elements of the symbology for a single shape with individual colors.
The values can be used to setup the color scheme for shapefile categories.
\new48 Added in version 4.8
The fill of polygon shapes or point symbols.
The second color of fill for polygon shapes or point symbols.
It is used when ShapeDrawingOptions.FillType = ftGradient.
The outlines of polygons and point symbols or the lines of polylines.
The back color of fill for polygons and point symbols.
It is used when ShapeDrawingOptions.FillType = ftHatch.
Defines possible states of the Shapefile class.
\new48 Added in version 4.8
The shapefile isn't initialized.
The instance of class is bound to particular file on disk.
See Shapefile.Filename to find out the file.
The instance of class holds in-memory shapefile, which isn't bound to the file on disk.
Such shapefiles can be created by Shapefile.CreateNew method with empty string as filename argument.
Defines possible spatial relations between 2 shapes.
\new48 Added in version 4.8
The possible units of measure for the data being displaying on map.
\new48 Added in version 4.8
The list of data types which can be returned as a result of expression evaluation.
See Table.TestExpression for the details.
\new48 Added in version 4.8
The drawing modes for vector data.
The enumeration is meant to setup a trade-off between performance (GDI) and the set of
available options (GDI+).
\new48 Added in version 4.8
All the elements of vector data will be drawn by GDI library.
Options like gradients or alpha blending are not supported in this mode.
The lines will be drawn using GDI library, while all the rest elements - GDI+.
All the elements of vector data will be drawn using GDI+.
The line smoothing will be carried out in this mode only.
The types of symbols for vertices of shapes when ShapeDrawingOptions.VerticesVisible = true.
\new48 Added in version 4.8
The position of labels (charts) relative to the data layers.
\new48 Added in version 4.8
Labels (charts) will be drawn immediately after the data layer.
As a result they can be covered by other data layers.
Labels (charts) will be drawn atop of all the data layers.
Possible datasource types for grids.
\new490 Added in version 4.9.0
No datasource was opened.
GDAL-based datasource is opened.
Non-GDAL in-memory datasource is opened.
Possible formats for images acting as visualization proxies for grid
\new491 Added in version 4.9.1
BMP format
GeoTiff format
Possible behaviours for displaying grid datasource. The behaviours will be used in AxMap.AddLayer and Grid.OpenAsImage methods.
\new491 Added in version 4.9.1
The following priorities are used:\n
1) direct rendering if GDAL overviews are available;
2) use of proxy image if a valid proxy already exists;\n
3) direct rendering + overview creation if datasource is supported by GDAL;\n
4) otherwise - proxy image will be created.
Disk-based proxy image will be created to display a grid.
Direct rendering will be used. If it's not possible (see Grid.CanDisplayWithoutProxy), than rendering operation will fail.
Possible events during the measuring process.
\new491 Added in version 4.9.1
Point was add with measuring tool.
Point was removed with measuring tool.
Measuring was stopped.
Possible reasons for grids no being able to be rendered directly by Image class without creating a proxy image.
\new491 Added in version 4.9.1
Grid can be rendered without image proxy.
Grid can not be rendered directly because the format isn't supported by GDAL.
Grid can not be rendered directly because of the large size. This limitation is artificial to ensure
acceptable performance. The maximum allowable size can be changed through GlobalSettings.MaxNoProxyGridSizeMb property.
Possible measuring types.
\new491 Added in version 4.9.1
Distance is measured. Area can be measured as well in this mode by closing the path
on one of the previous vertices and holding Ctrl.
Area is measured.
Methods for retrieval of existing color schemes from grid.
\new491 Added in version 4.9.1
All available retrieval methods will be executed until a first successful one is found.
The methods will be tried in the following order: gsrDiskBased, gsrDiskBasedForProxy, gsrGdalColorTable.
Color scheme from accompanying .mwleg file will be read if there is any (for example, grid.mwleg).
Color scheme from .mwleg file accompanying proxy image for the grid will be read if there is any (for example, grid_proxy.bmp.mwleg).
Built-in color scheme (stored in GeoTiff images, for examples) will retrieved if there is any.
Methods of generation of a new color scheme for grid.
\new491 Added in version 4.9.1
Gradient color scheme will be built.
Unique values color scheme will be built.
Unique values color scheme will be built if there is small number of unique values (GlobalSettings.MaxUniqueValuesCountForGridScheme),
if there are too may unique values, gradient color scheme will be built.
Possible tile server projection.
If additional projections are needed, they should be implemented in MapWinGIS code, there is
no way to do it in client code.
\new490 Added in version 4.9.0
Google Mercator, the most popular nowadays (GoogleMaps, BingMaps, OSM, etc.)
Amersfoort projection for Netherlands.
Types of map redraw.
Types of redraws other than RedrawAll maybe useful when large datasources are loaded of when frequent updates of only specific map content is necessary.
\new491 Added in version 4.9.1
All the map will be redrawn anew. Information cached in screen buffer won't be used.
Corresponds to AxMap.Redraw.
Data layers will be rendered from screen buffer. Everything else will be redrawn a new.
Updates shape editor and measuring tool. Data layers, drawing layers and layers in interactive editing mode will be rendered from screen buffer.
Map will be rendered from the main buffer. Only measurements and coordinate display will be rendered anew.
Corresponds to AxMap.Refresh/AxMap.Invalidate.
Possible coordinate formats to display current mouse cursor position on the map.
\new491 Added in version 4.9.1
No coordinates will be displayed.
If projection is set for map - degrees, otherwise - map units.
Together with AxMap.GrabProjectionFromData this mode can be used to quickly check whether certain
datasource has a valid projection.
Current position in decimal degrees will be displayed or no coordinates at all if no projection is set for map.
Position in current map units will be displayed, whatever that may be: meters, miles, decimal degrees, etc.
Commonly used map projections to be set in Form Designer (see AxMap.Projection property).
\new491 Added in version 4.9.1
Some projection not covered by this enumeration was specified manually or taken from the data.
Empty projection, the initial state of map.
WGS84 coordinate system (EPSG:4326, equirectangular projection will used implicitly during rendering).
So called Google Mercator projection (EPSG:3857; aka Spherical Mercator) commonly used by tile servers.
Possible zoom behaviours.
\new491 Added in version 4.9.1
Zooming is performed without binding to tile levels, which may result in scaling of tiles and certain distortions.
Each zoom operation will displayed the next zoom level for tiles. This will ensure that tiles aren't scaled,
which increases their readability and improve their general look. If no projection is set for map or tiles aren't
visible, default zooming will be used.
Type of MapWinGIS subsystems to check support for.
\new491 Added in version 4.9.1
GDAL library
Possible open strategies for datasources.
\new491 Added in version 4.9.1
Datasource format isn't supported and can't be opened by MapWinGIS .
Open strategy will be detected automatically. See FileManager.get_OpenStrategy for the details.
Datasource is opened by Image class as RGB image.
Grid is directly rendered by Image class using so called grid rendering. Datasource must be supported by GDAL in order for this strategy to work.
Grid is displayed using a proxy image file, specifically created for visualization. This requires significant time on proxy creation but faster rendering afterwards.
A single layer from vector datasource will be opened
(for shapefiles Shapefile class will be used; for other vector formats - OgrLayer; for multilayer datasources a first layer
will be returned).
Opens vector datasource using OgrDatasource class. Should be used with multi-layer vector formats, like KML to add all layers
to the map with a single call.
Possible state of validity flag for a field group operation.
\new491 Added in version 4.9.1
Operation is valid.
Operation can't be performed because no such field was found in the input shapefile.
Operation can't performed because it's not supported for the current field type (e.g. average on string type or mode on numeric types).
Possible statistic operations for a field during grouping of shapes.
\new491 Added in version 4.9.1
Sum of values within group.
Minimum value within group.
Maximum value within group.
Average value within group (for numeric fields only).
Weighted average value within group (for numeric fields only).
For polygons weighting by area is used for polylines - weighting by length, for other types - none.
Mode value (the value with the largest frequency) within group (for string fields only).
Type of shapefile validation.
\new491 Added in version 4.9.1
Validation of input of certain operation.
Validation of output of certain operation.
Possible validation modes for shapefiles.
\new491 Added in version 4.9.1
No validation is performed, invalid input shapes will be processed and invalid shapes will be passed to output.
An attempt will be made to fix invalid shapes. If fixing fails invalid shapes will be processed the same way as others.
An attempt will be made to fix invalid shapes. If fixing fails invalid shapes will be skipped, i.e. not processed and not passed to output.
An attempt will be made to fix invalid shapes. If fixing of at least one shape fails the whole operation will be aborted.
The whole operation will be aborted on finding at least one invalid shape, without trying to fix it.
Possible shape validation status. See also GlobalSettings.ShapeInputValidationMode, GlobalSettings.ShapeOutputValidationMode.
\new491 Added in version 4.9.1
Validation wasn't performed.
No invalid shapes were found.
Invalid shapes were found but all of the were fixed.
Some invalid shapes were skipped, after their fixing failed.
Some invalid shapes were accepted as input or passed to output after their fixing failed.
Operation was aborted because of invalid shapes.
Types of units to be used by scalebar.
\new491 Added in version 4.9.1
Metric units (centimetres, meters, kilometres).
Units of American system of measurements (miles, feet).
Mixed mode, when units of both metric and American system are displayed.
COM interfaces provided by MapWinGIS (Utils.CreateInstance can be used for creation of actual objects).
\new48 Added in version 4.8
GUI strings that may be localized.
\new491 Added in version 4.9.1
Hectares for area measurement. Default = "ha".
Meters for distance measurement. Default = "m".
Kilometres for distance measurement. Default = "km".
Square kilometres for area measurement. Default = "sq.km".
Square meters for area measurement. Default = "sq.m".
Undefined map units. Default = "mu".
Undefined area map units. Default value is "sq.mu".
Miles for distance measurement. Default value is "miles".
Feet for distance measurement. Default value is "feet".
Latitude for coordinates display. Default value is "Lat".
Longitude for coordinates display. Default value is "Lng".
Lists types of relation between tiles service projection and map projection.
\new491 Added in version 4.9.1
Projections match. tiles can be rendered without distortions.
Projections don't match, but transformation is possible. Tiles can be rendered with certain distortions.
No projection is set or it is not compatible with tile service projection. Tiles can't be displayed.
Defines possible state of a boolean property with some default behaviour.
\new492 Added in version 4.9.2
The behaviour will be selected automatically. It may differ from just true/false options.
Defines amount of information displayed via zoom bar tool tip.
\new492 Added in version 4.9.2
Only zoom level is displayed.
Zoom level, resolution and scale are displayed.
No tool tip is displayed.
Defined possible styles of zoom box.
\new492 Added in version 4.9.2
Possible raster overview creation modes.
Automatic choice of overview creation. Currently the same as rocYes.
GDAL overviews will be created.
GDAL overviews won't be created.
Available compression modes for TIFF files provided by GDAL driver.
See more informationhere
\new492 Added in version 4.9.2
Defines possible subjects of OgrLayer.SaveChanges method.
\new493 Added in version 4.9.3
Only shapes from associated in-memory shapefile will be saved.
Only values from attribute table of associated in-memory shapefile will be saved.
Both shapes and attributes of associated in-memory shapefile will be saved.
List of capabilities that might or might not be supported by particular OGR driver.
See description here.
\new493 Added in version 4.9.3
Possible results for OgrLayer.SaveChanges operation.
\new493 Added in version 4.9.3
No changes were found, i.e. there is no shape records with Shapefile.get_ShapeModified property set to true
in the underlying shapefile.
All shapes marked as modified were successfully saved.
Some of the shapes marked as modified were successfully saved, but for some the operation has failed.
None of the shapes marked as modified were saved.
Possible metadata items which can be associated with particular GDAL driver.
\new493 Added in version 4.9.3
List of capabilities that might or might not be supported by particular OGR datasource.
\new493 Added in version 4.9.3
Possible source types for instance of OgrLayer class.
\new493 Added in version 4.9.3
The instance isn't bound to any datasource, i.e. it's empty. The default state for any newly created instance.
The instance is bound to particular file-based format.
The instance is bound to a table of a spatial database.
The instance holds results of SQL query.
Possible string encodings for OgrDatasource, OgrLayer classes.
UTF-8 encoding.
Current ANSI codepage set in the OS for non-Unicode applications.
Possible modes for built-in cmIdentify tool.
All shapefile layers with Shapefile.Identifiable property set to true will be analyzed.
Only shapefile defined by Identifier.ActiveLayer will be identified.
Possible behaviors for Shape Editor.
User is allowed to move, add and delete vertices and move or delete the shape itself.
User is allowed to move or delete parts of multi-part shape.
Possible overlay operations for Shape Editor.
Adds part to the shape being edited.
Removes parts of edited shape by arbitrary polygon.
Possible types of caps for GEOS buffering.
Possible types of joins for GEOS buffering.
Possible ways to define values of shapefile category.
A shape falls into category if a given field exactly matches ShapefileCategory.MinValue.
A shapes falls into category if value of a given field is in interval between
ShapefileCategory.MinValue and ShapefileCategory.MaxValue.
A shape falls into category if its attribute values satisfy ShapefileCategory.Expression.
Possible validation modes for Shape Editor.
Some basic checks will be made: shape has enough points and parts for its type, ring direction for
polygon is correct, the first point of polygon matches the last one.
Invalid ring direction for polygon will be fixed automatically.
GEOS validation will be used in addition to basic validation but no attempt to fix errors
will made on this stage.
Same as evCheckWithGeos, only Shape.FixUp method will be called if GEOS validation failed.
Elements of shapes that can be deleted during interactive editing.
Possible ways to display length of segments for measuring tool and shape editor.
Depending on length either meters or kilometers will be used.
Depending on length either feet or miles will be used. These units are defined according to International yard and pound agreement (1959).
Possible editor states.
Editor isn't initialized.
Editor is in the process of creating a new shape which is bound to a certain shapefile.
Editor is in the process of editing an exiting shape of a certain shapefile.
Editor is in the process of creating of shape which isn't bound to particular shapefile.
This mode is used by built-in interactive tools, cmSelectByPolygon or cmSplitByPolyline.
Editor is in the process of adding of an overlay for current shape (eoAddPart, eoRemovePart).
Defines a set of layers to be analyzed by certain tool.
All layers will be used.
No layers will be used, i.e, the functionality is off.
Only active layer will be used.
Possible types of operations in undo list of Shape Editor.
Shape was added.
Shape was removed.
Shape was edited (i.e. vertices moved or deleted, parts added, etc).
A number of selected shapes were moved.
A number of selected shapes were rotated.
Defines either true and false value.
Some erratic behavior was observed when passing VARIANT_BOOL values through dispatch interface by reference.
Hence this enumeration is used.
Possible ways to display bearing of lines.
Absolute bearing (aka full circle bearing or azimuth). Calculated clockwise from the north direction. Range of values [0, 360] degrees.
Reduced bearing (US army definition of bearing). Absolute bearing split into 4 quadrants (NE, SE, SW, NW).
Calculated either from north (NE, NW quadrants) or south (SE, SW quadrants) direction. Range of values within quadrant is [0, 90] degrees.
Displayed like "N 45.0° E".
Same as btReducedNDE, apart from a bit different format: "NE: 45.0°".
Relative bearing, represents clockwise angle between direction of the previous line and the next line. Range of values [-180, 180] degrees.
If the next line turns to the left the value is negative, to the right - positive.
Left inner angle formed by the previous line and next line. Range of values [0, 360] degrees. If the next line has the same direction
as the previous one, the value is 180°.
Right inner angle formed by the previous line and the next line. Range of values [0, 360] degrees. If the next line has the same direction
as the previous one, the value is 180°.
Possible ways to display area.
Depending on area either square meters, hectares or square kilometers will be used.
Hectares only will be used.
Depending on area either square feet, acres or square miles will be used.
These units are defined according to International yard and pound agreement (1959).
Possible formats to display angles.
Possible values of the version parameter for WMS requests.
Possible levels of the callback verbosity.
The function groups.
The layer types.
Types of rendering for GDAL raster datasource.
Unknown (when no datasource is opened).
Gray scale rendering based on a single band.
RGB rendering based on at least 3 bands with possible addition of alpha band.
Rendering based on a single band and custom color scheme.
Rendering based on a single band and built-in color scheme.
A bit mask which defines custom events that will be fired during the rendering process.
GDAL data types.
Possible palette interpretations for a raster datasource.
Possible color interpretations for a raster band.
Types of proxy authentication.
Possible values of pixel offset mode (GDI+ rendering).
Supports the load of subsets of Projection Strings from Utils.GetProjectionStrings.
Can be combined to get NAD83 and/or WGS84, or the entire set.
A strongly-typed resource class, for looking up localized strings, etc.
Returns the cached ResourceManager instance used by this class.
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
Provides a functionality for accessing and editing ESRI shapefiles.
A class which encapsulates all the operation with ESRI shapefiles, for both file-based and in-memory mode.
Facilitates creation, editing, querying and geoprocessing of shapefiles. Shapefile holds geometry of objects
(.shp and .shx part) and their attribute values (.dbf part)
Here is a diagram for the Shapefile class.
\dot
digraph shapefile_diagram {
nodesep = 0.3;
ranksep = 0.3;
splines = ortho;
node [shape= "polygon", peripheries = 3, fontname=Helvetica, fontsize=9, color = gray, style = filled, height = 0.3, width = 0.8];
mcat [ label="ShapefileCategory" URL="\ref ShapefileCategory"];
pnt [ label="Point" URL="\ref Point"];
lb [ label="Label" URL="\ref Label"];
chart [ label="Chart" URL="\ref Chart"];
fld [ label="Field" URL="\ref Field"];
sf [ label="Shapefile" URL="\ref Shapefile"];
node [width = 0.6, height = 0.2]
shp [ label="Shape" URL="\ref Shape"];
node [color = tan, peripheries = 1, height = 0.3, width = 1.0];
lst [ label="ShapefileCategories" URL="\ref ShapefileCategories"];
tbl [ label="Table" URL="\ref Table"];
lbs [ label="Labels" URL="\ref Labels"];
cht [ label="Charts" URL="\ref Charts"];
node [style = dashed, color = gray];
map [ label="AxMap" URL="\ref AxMap"];
edge [ dir = "none", style = solid, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060", labeldistance = 0.6 ]
sf -> lst [ URL="\ref Shapefile.Categories", tooltip = "Shapefile.Categories", headlabel = " 1"];
sf -> tbl [ URL="\ref Shapefile.Table", tooltip = "Shapefile.Table", headlabel = " 1"];
sf -> lbs [ URL="\ref Shapefile.Labels", tooltip = "Shapefile.Labels", headlabel = " 1"];
sf -> cht [ URL="\ref Shapefile.Charts", tooltip = "Shapefile.Charts", headlabel = " 1"];
sf -> shp [ URL="\ref Shapefile.get_Shape()", tooltip = "Shapefile.get_Shape()", headlabel = " n"];
shp -> pnt [ URL="\ref Shape.get_Point()", tooltip = "Shapefile.get_Point()", headlabel = " n"];
lst -> mcat [ URL="\ref ShapefileCategories.get_Item()", tooltip = "ShapefileCategories.get_Item()", headlabel = " n"];
tbl -> fld [ URL="\ref Table.get_Field()", tooltip = "Table.get_Field()", headlabel = " n"];
lbs -> lb [ URL="\ref Labels.get_Label()", tooltip = "Labels.get_Label()", headlabel = " n"];
cht -> chart [ URL="\ref Charts.get_Chart()", tooltip = "Charts.get_Chart()", headlabel = " n"];
map -> sf [ URL="\ref AxMap.get_Shapefile()", tooltip = "AxMap.get_Shapefile()", headlabel = " n"];
}
\enddot
Graph description\n\n
Here are groups of API members for Shapefile class:
\dotfile shapefilegroups.dot
Graph description\n\n
Gets or sets an instance of ShapefileCategories class associated with the shapefile.
The property can't be set to NULL (there is always an instance ShapefileCategories class associated with the Shapefile).
\new48 Added in version 4.8
Gets expression to be set for OpenFileDialog.Filter property to select ESRI shapefiles.
Gets or sets collision mode for point symbols for point and multi-point shapefiles.
See tkCollisionMode enumeration.
\new48 Added in version 4.8
Gets or sets an instance of ShapeDrawingOptions class which holds default drawing options.
Default options are applied to every shape, which doesn't belong to a shapefile category.
The property can't be set to NULL (there is always an instance ShapeDrawingOptions class associated with shapefile).
\new48 Added in version 4.8
Restores the state of shapefile from the string.
The value which indicates whether selection state of individual shapes should be restored.
A string with state information generated by Shapefile.Serialize method.
\new48 Added in version 4.8
Saves the state of the shapefile in XML string.
Serialization covers shapefile properties and all child classes (drawing options, labels, charts, categories).
Geometry of shapes and values of attribute table will not be serialized.
The value which indicates whether selection state of individual shapes should be saved.
A string with serialized state or empty string on failure.
Use Shapefile.ErrorMsg(Shapefile.LastErrorCode) to find out the reason of failure.
\new48 Added in version 4.8
Gets bounding box which encompass all the shapes in the shapefile.
When fast mode is set on, Shapefile.RefreshExtents call is needed to get the correct
extents after edits where made.
Returns the handle of the shapefile. For inner use only.
Gets the name of the file which is used as a source for this instance of Shapefile class.
The property should be used for disk-based shapefiles only (see Shapefile.SourceType property).
Generates labels for the shapefile based on values of the specified attribute.
The index of field in the attribute table to take the values from.
The method for calculation of label positions.
A value which indicates whether all the parts of a multi-part shape should be supplied with individual
labels or only the largest (longest) one.
The number of labels generated. Normally it is equal to the number of shapes.
Labels of the multi-part shape are treated like a single label.
\new48 Added in version 4.8
Gets or sets the instance of the Labels class associated with the shapefile.
The property can't be set to NULL (there is always an instance Labels class associated with shapefile).
\new48 Added in version 4.8
Gets or sets an instance of Charts class associated with the shapefile.
The property can't be set to NULL (there is always an instance of Charts class associated with shapefile).
\new48 Added in version 4.8
Get or sets an instance of GeoProjection class associated with the shapefile.
The property can't be set to NULL (there is always an instance of GeoProjection class associated with the shapefile).
\new48 Added in version 4.8
Gets or sets a Callback object which handles progress and error messages of the Shapefile class.
It's recommended to set it in case time consuming operation will be used (geoprocessing, generation of labels, etc).
The property is equal to NULL by default.
\deprecated v4.9.3 Use GlobalSettings.ApplicationCallback instead.
Sets an object which implements IStopExecution interface and facilitates stopping of the
geoprocessing operations.
\new48 Added in version 4.8
A text string associated with the shapefile. Any value can be stored by developer in this property.
Gets the code of last error which took place inside this object.
To retrieve text description of error, use Shapefile.get_ErrorMsg(Shapefile.LastErrorCode).
Check this value if a certain method has failed.
Gets the number of shapes in the shapefile.
Gets or sets the projection string for shapefile. String in proj4 and ESRI WKT formats are supported.
\deprecated v 4.8 Use Shapefile.GeoProjection property instead.
Gets the type of the shapefile.
It is not possible to change the type of the shapefile without closing it.
Gets the value which indicate the type the data used by shapefile object.
See details in the description of tkShapefileSourceType enumeration.
\new48 Added in version 4.8
Gets or sets the expression which defines shapes to be visible on the map.
In case of empty or invalid string all the shapes will be visible.
\new48 Added in version 4.8
Gets the description of the specific error code.
The error code returned by Shapefile.LastErrorCode.
The string with the description.
Gets the index of the visualization category which is used for the drawing of the specified shape.
The index of the shape.
The index of the category. -1 will be returned in case no category is set to the shape or
invalid shape index was passed.
\see Shapefile.Categories
\new48 Added in version 4.8
Sets the index of the visualization category to use for the drawing of the specified shape.
The index of the shape.
The index of the visualization category.
\see Shapefile.Categories
\new48 Added in version 4.8
Get the name of the ShapefileCategory for the shape with specified index.
Index of shape.
The name of the category.
\new491 Added in version 4.9.1
Sets the shapefile category for the shape.
Index of shape.
Name of the category. Category must be created first. Name comparison is case-sensitive.
\new491 Added in version 4.9.1
Gets the shapefile category for the shape with specified index.
Index of shape.
Shapefile category, or null if no category for the shape was set.
\new491 Added in version 4.9.1
Sets the shapefile category for the shape.
Index of shape.
Shapefile category to set. The category must be added to shapefile beforehand.
\new491 Added in version 4.9.1
Gets the reference to the specified shape.
In the disk-based mode (Shapefile.SourceType = sstDiskBased) a new instance of the Shape class will be created
on each call of this property which is time consuming. Try to avoid calling this property in large cycles or
open editing mode prior such cycles. In editing mode shape objects stored in memory, so there is no overhead in passing the
reference.
The index of shape to retrieve.
The reference to the shape or NULL reference on invalid index.
Gets "flattened" shapefile type, i.e. Z and M components will be ignored.
\new493 Added in version 4.9.3
Gets rotation angle for a shape.
Index of shape.
Angle in degrees (0-360).
This value will be applied for icons of point shapefiles only (ShapeDrawingOptions.PointType = ptSymbolPicture).
Values other then 0.0 will override ShapeDrawingOptions.PointRotation property for shapefile and categories.
\new492 Added in version 4.9.2
Sets rotation angle for a shape.
Index of shape.
Angle in degrees (0-360).
This value will be applied for icons of point shapefiles only (ShapeDrawingOptions.PointType = ptSymbolPicture).
Values other then 0.0 will override ShapeDrawingOptions.PointRotation property for shapefile and categories.
\new492 Added in version 4.9.2
Gets visibility of shape.
Index of shape.
True if shape is visible.
The property takes into account Shapefile.VisibilityExpression,
Shapefile.get_ShapeIsHidden, ShapeDrawingOptions.Visible
\new492 Added in version 4.9.2
Serializes the state shapefile object, but not the data itself.
True is selection on per-shape basis should be serialized.
True if categories should be serialize on per-shape basis.
The option should be used when categories were applied manually with Shapefile.put_ShapeCategory.
XML string with serialized state.
\see Shapefile.Serialize
\new493 Added in version 4.9.3
Gets a value indicating whether a shape is hidden.
Even when this property is set to false, the shape may still be invisible because of other settings.
Use Shapefile.get_ShapeVisible to check if it will actually be displayed on the screen
when corresponding portion of map is rendered.
Index of shape.
True in case shape is hidden.
\new493 Added in version 4.9.3
When set to true prevents shape from being displayed.
This property is used internally by interactive editing tools.
Index of shape.
Value indicating whether the shape is hidden.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether this shapefile will be visible to cmIdentify tool.
\see AxMap.CursorMode
\new493 Added in version 4.9.3
Moves shapefile at specified offset.
Shapefile must be in editing mode in order for this method to succeed.
X component of offset.
Y component of offset.
True on success.
\new493 Added in version 4.9.3
Gets a value indicating whether particular shape is currently displayed on the screen.
This property is set during the core rendering process, therefore
it accounts for all possible ways for a certain shape to be hidden, like collision
avoidance for point symbols or dynamic visibility for categories.
\new493 Added in version 4.9.3
Stops append mode for the shapefile.
\new494 Added in version 4.9.4
Starts append mode for the shapefile.
True on success
\new494 Added in version 4.9.4
Gets a value indicating whether shapefile is in append mode.
Any shapes added with Shapefile.EditAddShape will be immediately written to the disk.
\new494 Added in version 4.9.4
The sorting of the shapefile will be reapplied before next redraw after calling this method.
\new494 Added in version 4.9.4
Fixes invalid shapes in the shapefile.
Only selected shapes will be fixed.
The resulting shapefile.
True if the operations was successful.
\new494 Added in version 4.9.4
The name of the field to be used to determine the drawing order of point shapes and labels.
\new494 Added in version 4.9.4
Gets or sets a value indicating whether shapes will be sorted in ascending order.
\see SortField
\new494 Added in version 4.9.4
Gets a specific field stored in the attribute table.
The index of the field to be retrieved.
Reference to the field object or NULL reference on failure.
Gets specific field stored in the attribute table.
The name of the field to be retrieved. The comparison of the names is case insensitive.
Reference to the field object or NULL reference on failure.
Sets the new value for particular cell in attribute table. The table must be in editing mode.
The index of field in attribute table.
The index of shape (row number in attribute table).
The variant value to be passed (integer, double and string values are accepted depending on field type).
True on success and false otherwise.
Deletes a field with the specified index from the attribute table. The table must be in editing mode.
An index of field to be deleted.
An instance of class implementing ICallback interface.
It's recommended to pass NULL and use Shapefile.GlobalCallback property instead.
Returns true on success and false otherwise
Inserts a new field in the shapefile attribute table. The table must be in editing mode.
A new instance of field object to insert.
A position to insert the new field. An invalid index will be automatically substituted with 0 or Shapefile.NumFields.
An instance of class implementing ICallback interface.
It's recommended to pass NULL and use Shapefile.GlobalCallback property instead.
True on success and false otherwise.
Gets the value indicating whether editing operations are allowed for shapefile attribute table.
Use Shapefile.StartEditingTable and Shapefile.StopEditingTable to control editing mode.
Gets the number of fields in attribute table of the shapefile.
Gets the reference to the attribute table associated with the shapefile.
Opens editing mode for the attribute table.
A callback object to report errors and progress information.
True on success and false otherwise.
Closes the editing mode for the attribute table.
A boolean value which indicates whether changes made to the memory version of table should be saved to the drive.
A callback object to report errors and progress information.
True on success and false otherwise.
Adds a field to the attribute table of the shapefile. The table must be in editing mode.
The name of field.
The type of field.
The precision of field.
The width of field.
The index of the new field or -1 on failure.
Gets index of field with specified name.
Field name.
Index of field in attribute table or -1 if no such field is found.
\new493 Added in version 4.9.3
\addtogroup shapefile_editing Shapefile editing
Here is a list of properties and methods which control the editing of shapefile.
This module is a part of the documentation of Shapefile class.
\dot
digraph shapefile_editing {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Shapefile" URL="\ref Shapefile"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Editing" URL="\ref shapefile_editing"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Deletes all the shapes from the shapefile.
Both shapefile and attribute table must be in editing mode for the successful operation.
The records of attribute table will be removed as well to ensure shapefile integrity.
Returns true on success and false otherwise.
Deletes a shape from the shapefile.
Both shapefile and attribute table must be in editing mode for the successful operation.
Corresponding record will be removed from attribute table to ensure shapefile integrity.
Indices of shapes after the deleted one will be decreased by 1 after the operation.
The index of shape to delete.
Returns true on success and false otherwise.
\see Shapefile.EditingShapes, Shapefile.EditingTable
Inserts a new shape in the shapefile.
Both shapefile and attribute table must be in editing mode for the successful operation.
A record will be automatically added to the attribute table to ensure shapefile integrity.
The shape object to insert.
The index to insert the new shape at.
An invalid index will be automatically substituted with closest allowable value without reporting the error.
True on success and false otherwise.
Gets the value indicating whether editing operations are allowed for shapefile.
Shapefile.EditInsertShape, Shapefile.EditDeleteShape, Shapefile.EditClear are affected by this property.
\n Use Shapefile.StartEditingShapes and Shapefile.StopEditingShapes to control the editing mode.
Starts editing mode for the shapefile.
In case editing mode has already been opened the new call will return true which
is different from the behaviour of the earlier versions (before 4.8).
A value which indicate whether or not the editing mode will be opened
for attribute table associated with the shapefile.
A callback object to report errors and progress information.
Returns true on successful opening of the editing mode and false on failure.
Stops editing modes for the shapefile and optionally saves the changes.
The value which indicates whether changes made to the shapefile should be saved.
The value which indicates whether editing mode for associated attribute table
should be closed as well.
A callback object to report errors and progress information.
True on success and false otherwise.
Adds a new shape to the shapefile.
The shape to be added.
The index of the new shape or -1 on failure.
Gets a value indicating whether particular shape was modified after shapefile was opened.
Index of shape.
The value of modified flag.
This property is used by OgrLayer.SaveChanges method to determine shape records
to be updated in datasource. The flag is set to true automatically only on insertion of a new
shape. For other types of edits (editing of vertices, editing of attributes) the flag
must be set in the client code.
\new493 Added in version 4.9.3
Sets a value indicating whether particular shape was modified after shapefile was opened.
This property is used by OgrLayer.SaveChanges method to determine shape records
to be updated in datasource. The flag is set to true automatically only on insertion of a new
shape. For other types of edits (editing of vertices, editing of attributes) the flag
must be set in the client code.
Index of shape.
New value of modified flag.
New value of modified flag.
\new493 Added in version 4.9.3
Substitutes shape at specified index with another instance.
The method doesn't affect attribute table values.
Index of shape to substitute.
New shape to substitute an existing one with.
True on success.
\new493 Added in version 4.9.3
Gets or sets a value indicating whether shapefile can be redrawn without redrawing other layer on the map.
All volatile shapefiles will be placed in main screen buffer (along with drawing layers) rather than data layer buffer,
so that their redraw can be forced with AxMap.Redraw2(tkRedrawType.RedrawSkipDataLayers). This can be recommended
for in-memory shapefiles with constantly changing values to ensure rendering performance.
\new492 Added in version 4.9.2
Gets or sets a value indicating whether a shapefile can be edited with built-in interactive tools.
Setting the property to true will automatically call Shapefile.StartEditingShapes if
shapefile hasn't been loaded in the memory already. Setting it false won't call Shapefile.StopEditingShapes,
only interactive tools will be disabled.
Interactive editing mode automatically sets Shapefile.Volatile property to true.
\see ShapeEditor, AxMap.CursorMode
\new493 Added in version 4.9.3
Gets or sets a value indicating whether interactive editing tools can snap to vertices of the shapefile.
\new493 Added in version 4.9.3
\addtogroup shapefile_geoprocessing Shapefile geoprocessing
Here is a list of methods to perform geoprocessing tasks using shapefile data.
This module is a part of the documentation of Shapefile class.
\dot
digraph shapefile_geoprocessing {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Shapefile" URL="\ref Shapefile"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Geoprocessing" URL="\ref shapefile_geoprocessing"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Creates a new shapefile by creating multi-part shapes from shapes with the same value of specified attribute.
See sample code in description of Shapefile.DissolveWithStats.
A value which indicates whether all or only selected shapes will be processed.
The index of field to group shapes by.
Statistic group operations to be calculated for fields of input shapefile
and written to attribute table of output shapefile.
Reference to the shapefile on success or NULL reference on failure.
\new491 Added in version 4.9.1
Merges shapes of the input shapefile based on specified attribute.
All shapes with the same value of the attribute will be merged in a single shape.
If the shapes aren't adjacent, then multi-part shape will be created.
\code
const string filename = @"d:\counties.shp";
var sf = new Shapefile();
if (!sf.Open(filename, null))
{
MessageBox.Show("Failed to open shapefile");
}
else
{
const int stateNameFieldIndex = 1;
var operations = new FieldStatOperations();
operations.AddFieldName("SUB_REGION", tkFieldStatOperation.fsoMin);
operations.AddFieldName("sub_region", tkFieldStatOperation.fsoMax); // casing doesn't matter
operations.AddFieldName("pop1990", tkFieldStatOperation.fsoSum);
operations.AddFieldName("pop1990", tkFieldStatOperation.fsoAvg);
operations.AddFieldName("pop1990", tkFieldStatOperation.fsoWeightedAvg);
var result = sf.DissolveWithStats(stateNameFieldIndex, false, operations);
axMap1.RemoveAllLayers();
axMap1.AddLayer(result, true);
result.SaveAs(@"d:\dissolve_result.shp");
}
\endcode
An index of field from attribute table of the shapefile to dissolve by.
A boolean value which indicates whether all or only selected shapes will be processed.
Statistic group operations to be calculated for fields of input shapefile
and written to attribute table of output shapefile.
Reference to the output shapefile or NULL reference on failure.
\new491 Added in version 4.9.1
Creates a new shapefile by creating multi-part shapes from shapes with the same value of specified attribute.
A boolean value which indicates whether all or only selected shapes will be processed.
The index of field to group shapes by.
Reference to the shapefile on success or NULL reference on failure.
\new48 Added in version 4.8
Creates a new shapefile by building a buffer around the shapes of the input shapefile.
The distance to build buffer at.
Number of segments to approximate a circular buffer.
A value which indicates whether all only selected shapes of the
shapefile will be processed.
A value which indicates whether overlapping buffered shapes
will be merged into a single shapes.
A reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Clips current shapefile by the definition shapefile.
A value which indicates whether all or only selected shape of this shapefile
will be treated as input.
The definition shapefile.
A value which indicates whether all or only selected shape of the definition shapefile
will be treated as input.
Reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Calculates difference of 2 shapefiles.
A value which indicates whether all or only selected shape of this shapefile
will be treated as input.
The overlay shapefile.
A value which indicates whether all or only selected shape of the overlay shapefile
will be treated as input.
Reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Merges shapes of the input shapefile based on specified attribute.
All shapes with the same value of the attribute will be merged in a single shape.
If the shapes aren't adjacent, then multi-part shape will be created.
An index of field from attribute table of the shapefile to dissolve by.
A boolean value which indicates whether all or only selected shapes will be processed.
Reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Creates a new instance of shapefile class with single-part shapes produced from the
multi-part shapes of the input shapefile.
Single-part input shapes are moved to the output shapefile
without changes. Attribute values are copied to the output shapefile without changes.
A value which indicates whether the operation will be applied to the selected shapes only.
A new instance of Shapefile class with resultant shapes or NULL reference on failure.
\new48 Added in version 4.8
Creates a new instance of the shapefile class and copies selected shapes of the input shapefile to it.
A new instance of shapefile class with selected shapes or NULL reference on failure.
\new48 Added in version 4.8
Creates a new shapefile by fixing invalid shapes of the input shapefile.
The output shapefile.
True on successful fixing of all shapes and false if at least one shapes wasn't fixed.
\new48 Added in version 4.8
Gets or sets the engine (library) to use for geoprocessing operations.
The following methods are affected by this property.
\new48 Added in version 4.8
Calculates intersection of 2 input shapefiles.
Intersection can generate shapes of different types. For example, the intersection of 2 polygons can be
a polygon, a polyline, a point or any combination of those. With SHP_NULLSHAPE fileType parameter the most obvious type will be used:
for example SHP_POLYGON for 2 polygon shapefiles.
A value which indicates whether operation will be applied to the selected shapes of the current shapefile only.
The second shapefile to perfrom intersection.
A value which indicates whether operation will be applied to the selected shapes of the second shapefile only.
The type of output shapefiles. SHP_NULLSHAPE value should be passed for automatic choosing of type.
An instance of class implementing ICallback interface.
Reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Creates a new instance of shapefile class which holds shapes from 2 input shapefiles.
Both shapefiles must have the same ShpfileType. No changes to geometry of individual shapes are made.
Attribute values of both input shapefile will be passed to the resulting one.
The value which indicates whether the operation will be applied
only to the selected shapes of the first shapefile.
The second shapefile to take shapes from.
A value which Indicates whether the operation will be applied
only to the selected shapes of the second shapefile
Reference to the output shapefile or NULL reference on failure
\new48 Added in version 4.8
Creates a new shapefile by re-projecting the current one.
The projection of the output shapefile.
The output value with the number of shapes successfully reprojected.
Reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Reprojects shapes of the current shapefile.
The new projection.
The number of shapes successfully reprojected.
Returns true on success and false otherwise.
\new48 Added in version 4.8
aka SpatialQuery. Returns an array with indices of shapes of the current shapefile which
are in the specified relation to the definition shapefile.
The definition shapefile.
The target relation between shapes of the 2 shapefiles.
The value which indicates whether only selected shapes of the definition shapefile will be used.
The resulting array of long data type with shape indices.
A callback object for passing to the client
the information about the progress and errors.
True in case at least one shape was selected and false otherwise.
\new48 Added in version 4.8
Creates a new shapefile by removing excessive vertices from the current shapefile
Applicable to the polyline or polygon shapefiles only.
The initial shapefile remains intact. Attribute values are copied to the output shapefile without changes.
The minimal distance between 2 succeeding points. A succeeding point lying closer than
this value, will be removed.
A value which indicates whether all or only selected shapes will be processed.
A reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Sorts shapes in the shapefile based on the specified attribute.
The index of field to set the sorting order.
A value which defines the sorting order.
Reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Calculates symmetrical difference of the 2 shapefiles.
The operation consists of 2 mirror-like Difference operations.
Attribute values of both shapefiles are passed to the output one without changes.
Both input shapefiles remain intact.
A value which indicates that only selected shapes of the first shapefile will be processed.
The second shapefile.
A value which indicates that only selected shapes of the second shapefile will be processed.
A reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Calculates union of 2 shapefiles.
The operation consists of intersection operation and 2 mirror-like difference operations.
The value which indicates that only selected shapes of the first shapefile will be processed.
The second shapefile.
The value which indicates that only selected shapes of the second shapefile will be processed.
A reference to the output shapefile or NULL reference on failure.
\new48 Added in version 4.8
Splits polylines at intersection with any other polylines. Works for polyline shapefile only.
Resulting shapefile or null if the operation wasn't successful.
\new490 Added in version 4.9.0
Clears GEOS geometries cached during certain geoprocessing tasks.
Shapefile.GetRelatedShapes currently is the only method that uses such caching
to improve performance if search is performed multiple times for different shapes.
\new491 Added in version 4.9.1
\addtogroup shapefile_management Shapefile open and close
Here is a list of methods which affect the state of the shapefile.
This module is a part of the documentation of Shapefile class.
\dot
digraph shapefile_management {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Shapefile" URL="\ref Shapefile"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Management" URL="\ref shapefile_management"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Loads data into in-memory shapefile from the specified shapefile on the disk.
Filename of the shapefile to load from.
Callback interface.
True on success and false otherwise.
The shapefile object with remain in in-memory state.
\new491 Added in version 4.9.1
Writes the contents of the shapefile to specified file.
Filename to write shapefile data to.
Callback interface.
True on success and false otherwise.
The state of shapefile won't be affected, i.e. in-memory shapefile will remain in-memory one.
\new491 Added in version 4.9.1
Creates a copy of the shapefile.
Output shapefile will have the same type, projection and fields of the attribute table,
while shapes and the records of the attribute table aren't copied.
For complete copy of the shapefile use Shapefile.SelectAll() and Shapefile.ExportSelection().
\new48 Added in version 4.8
Closes shapefile and releases all the resources.
In case shapefile is in editing mode (Shapefile.EditingShapes = true)
all the edits will be discarded.
This value should not be analysed.
Initializes in-memory shapefile of the specified type with unique index field.
MWShapeID field will be added to the attribute table. An increasing unique positive integer value
will be set in this field for each shape added to the shapefile. The field with MWShapeID name
created manually will be treated in the same way.
The name of the new shapefile. An empty string should be passed here.
Type of the shapefile to create.
Returns true on success and false otherwise.
Opens shapefile from the disk.
Any other shapefile currently opened will be closed without saving the changes.
Shapefile.SourceType property will be set to sstDiskBased.
The name of the file to open (.shp extension).
A callback object to report errors and progress information.
True on success and false otherwise.
Use Shapefile.get_ErrorMsg(Shapefile.LastErrorCode) to find out the reason of failure.
Changes file associated with the current instance of the shapefile class.
It is equivalent to consequent calling of Shapefile.Close and Shapefile.Open.
The filename of the new shapefile to be opened.
True on successful opening of the new shapefile or false otherwise.
Saves edits of the in-memory shapefile to the disk without closing editing mode.
Applicable only when Shapefile.EditingShapes = true.
A callback object to report errors and progress information.
True on successful saving and false otherwise.
Saves in-memory shapefile to the disk.
The name of the file to save data in.
A callback object to report errors and progress information.
True on successful saving and false otherwise.
Saves shapefile to the disk.
The new filename.
If set to true the editing for shapefile will be stopped.
If set to true the file will not be assigned as a source of this instance.
True on success.
\new494 Added in version 4.9.4
\addtogroup shapefile_optimizations Shapefile optimizations
Here is a list of properties and methods which doesn't provide additional functionality but
can improve the speed of certain operations with shapefile.
This module is a part of the documentation of Shapefile class.
\dot
digraph shapefile_optimizations {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Shapefile" URL="\ref Shapefile"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Optimizations" URL="\ref shapefile_optimizations"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Gets or sets a boolean value which indicates whether extents of shape will be recalculated before each redraw.
When the property is set to:
- false: MapWinGIS recalculates the extents of each shape before the redraw assuming that some
changes *MIGHT* took place. The operation can slow down the drawing for large shapefiles.\n\n
- true: MapWinGIS doesn't recalculate extents of the shapes which leads to faster drawing but also
makes a developer responsible for updating the extents of shapes in the due time.
To do it one need to call Shapefile.RefreshShapeExtents after each editing operation. Otherwise
there is a chance that old extents of the shape may lie outside the visible area of the map and the shape won't be displayed.\n
.
When Shapefile.FastMode is turned on the extents are cached automatically in spite of this property.
Also the extents will be automatically refreshed after Shape.put_XY call. However
Shape.get_Point().x = [value] call will not be tracked. Therefore Shapefile.RefreshShapeExtents will still be needed.\n
To avoid confusion use the following recommendation:
-# If you work with small shapefile and performance isn't a problem, set this property to false.\n\n
-# If the performance is an issue:
- if you write a new code, set this property to true (as well as Shapefile.FastMode),
but assign new coordinates to the points by calling Shape.put_XY only;
- if you are bound to the exiting code with Shape.get_Point.x = [value] calls, set this property to true but call
Shapefile.RefreshShapeExtents after the editing operations.
\new48 Added in version 4.8
Caches the coordinates of shapefile points for faster point in shape test.
Shapefile.EndPointInShapefile call is needed to release the memory.
True on successful caching and false otherwise.
Clears the cached data allocated by Shapefile.BeginPointInShapefile.
Returns boolean value which indicates whether the given point is located within the specified shape.
The operation is applicable for polygon shapefiles only.
The index shape (polygon) to perform the test.
X coordinate of the point.
Y coordinate of the point.
True in case the point is located within polygon and false otherwise.
Returns a number which indicates the index of shapes within which a test point is situated.
Call Shapefile.BeginPointInShapefile to improve performance.
The x coordinate of the point.
The y coordinate of the point.
The index of shape.
Gets or sets the value which indicates whether fast mode will be used for the shapefile.
The mode ensures faster drawing but makes the client responsible for the refreshing of shapefile extents
after editing operation (see Shapefile.RefreshExtents and Shapefile.RefreshShapeExtents). It's highly recommended
to use the mode for large shapefiles.
\new48 Added in version 4.8
Gets or sets the value which affects the drawing of small shapes on the screen.
The objects with scaled size less than this value will be drawn as a single dot.
This can noticeably increase performance for large shapefiles at full scale.
But with the increase of speed the quality of drawing will be deteriorating.
The default value is 1.
\new48 Added in version 4.8
Returns the number of points in the specified shape of the shapefile.
This property is more efficient than calling Shapefile.get_Shape().NumPoints.
The index of the shape.
The number of points or -1 in case of invalid index.
There is a confusion with name casing for this property.
It's actually spelled 'get_NumPoints' in the source code.
However because of the known bug in PIA generation process the property
ended up spelled 'get_numPoints' in earlier version of PIAs. After some hesitation we decided to keep it that way.
See description of the bug here: http://stackoverflow.com/questions/3179676/c-exposed-property-for-com-in-idl-is-showing-as-lower-case-all-of-a-sudden
Returns the extents of the shape with the given index.
This operation is faster than Shapefile.get_Shape().Extents as there is no need to read all the shape data.
The index of the shape.
The extents of shape or NULL reference on failure.
Returns the specified point of shape.
This operation doesn't require the reading of all shape date from disk, therefore
it will be faster when editing mode is false.
The index of shape.
The point index.
The point or the NULL reference on the invalid index.
Returns an array with the coordinates of points of the specified shape.
The value specified in numPoints will be adjusted if the specified number is greater than the number of points.
The index of shape.
The number of point to return.
The array of double type with coordinates of the point.
Every two elements represent x and y coordinate of the point respectively.
Refreshes extents of all shapes in the shapefile.
See Shapefile.CacheExtents for the details.
The value can be omitted.
\new48 Added in version 4.8
Refreshes the extents of the particular shape in the shapefile.
See Shapefile.CacheExtents for the details.
The index of the shape which extents are to be refreshed.
True on success and false in case of invalid shape index.
\new48 Added in version 4.8
\addtogroup shapefile_selection Shapefile selection
Here is a list of properties and methods for managing shapefile selection.
This module is a part of the documentation of Shapefile class.
\dot
digraph shapefile_selection {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Shapefile" URL="\ref Shapefile"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Selection" URL="\ref shapefile_selection"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Gets the vertex closest to the specified point.
X coordinate of the point to search from.
Y coordinate of the point to search from.
Maximum distance to search. Use 0 to search at any distance. Passing the max distance can improve performance.
Index of shape to which closest vertex belongs.
Index of closest vertex within shape.
The distance to the closest vertex.
True if the vertex was found within specified distance and false otherwise.
\new490 Added in version 4.9.0
Gets shapes which are located at specified spatial relation to reference shape.
Index of reference shape.
Spatial relation. Isn't implemented for Disjoint.
The array of indices of the found shapes (int[])
True if at least one related shape was found.
\new490 Added in version 4.9.0
Gets shapes which are located at specified spatial relation to reference shape.
Reference shape.
Spatial relation. Isn't implemented for Disjoint.
The array of indices of the found shapes (int[])
True if at least one related shape was found.
\new490 Added in version 4.9.0
Gets the state of selection for the specified shape
The index of shape
True in case the shape is selected and false otherwise.
\new48 Added in version 4.8
Selects or deselects the specified shape
The index of shape to be selected.
A value which indicates whether a shape should be selected.
\new48 Added in version 4.8
Inverts selection of the shapefile, i.e. selection state of every shape is changed to the opposite value.
\see Shapefile.get_ShapeSelected
\new48 Added in version 4.8
Gets the number of selected shapes in the shapefile.
\see Shapefile.get_ShapeSelected
\new48 Added in version 4.8
Selects all the shapes in the shapefile
\new48 Added in version 4.8
Clears selection from all shapes.
\new48 Added in version 4.8
Gets or sets the way shapefile selection will be displayed.
See MapWinGIS.tkSelectionAppearance for the details.
\new48 Added in version 4.8
The colour of the selected shapes.
It is used when SelectionAppearance is set to saSelectionColor.
\new48 Added in version 4.8
The drawing options used for visualization of the selected shapes.
It is used when SelectionAppearance is set to saDrawingOptions.
\new48 Added in version 4.8
Gets or sets the value which defines the transparency of the selection.
Values from 0 (transparent) to 255(opaque) are applicable.
\new48 Added in version 4.8
Returns an array with indices of shapes which are located inside specified bounds.
This method doesn't change the state of selection or visualization of shapes.
The bounding rectangular to select shapes within.
The value of tolerance.
Selection mode.
An output array of long type with the indices of the shapes.
True in case at least one shape is within bounds and false otherwise.
\addtogroup shapefile_spatial_index Shapefile spatial index
Here is a list of properties and methods for managing of spatial index for a shapefile.
This module is a part of the documentation of Shapefile class.
\dot
digraph shapefile_sptial_index {
splines = true;
node [shape= "polygon", fontname=Helvetica, fontsize=9, style = filled, color = palegreen, height = 0.3, width = 1.2];
lb [ label="Shapefile" URL="\ref Shapefile"];
node [shape = "ellipse", color = khaki, width = 0.2, height = 0.2, style = filled]
gr [label="Spatial index" URL="\ref shapefile_spatial_index"];
edge [ arrowhead="open", style = solid, arrowsize = 0.6, fontname = "Arial", fontsize = 9, fontcolor = blue, color = "#606060" ]
lb -> gr;
}
\enddot
Graph description
@{
Gets the value which indicates whether spatial index will be used
for displaying certain extents of the shapefile.
\see SpatialIndexMaxAreaPercent
Creates a new spatial index
The name of shapefile to create spatial index for.
Filename of the current shapefile should be passed usually (Shapefile.Filename).
Gets the value indicating whether spatial index exists for the shapefile.
The set part of property does nothing. Use Shapefile.CreateSpatialIndex instead to create a new index.
Checks the validity of the spatial index.
True if the index is valid and false on its absence or incompatibility.
Gets or sets the value which affects the usage of spatial index.
Spatial index won't be used while drawing a part of shapefile larger then specified percent.
Spatial index ensures faster access to the shapes while a small portion of shapefile
is being displayed. On the contrary when substantial part of shapefile is being displayed
spatial index can decrease the performance. This property blocks the usage of
spatial index when it is inefficient.
Gets or sets a value which indicates whether built-in quad-tree spatial index should be used for shapefile.
Quad is used in editing mode only. It has nothing to do with disk based spatial index which is used by methods like Shapefile.CreateSpatialIndex.
\new48 Added in version 4.8
Gets or sets a value which indicates whether spatial index should be used
while working with shapefile.
Removes spatial index associated with shapefile (.mwd and .mwx files).
True on success.
\new493 Added in version 4.9.3
Gets results of input data validation for geoprocessing methods.
Use GlobalSettings.ShapeInputValidationMode to change the settings.
\new491 Added in version 4.9.1
Gets results of output data validation for geoprocessing methods.
Use GlobalSettings.ShapeOutputValidationMode to change the settings.
\new491 Added in version 4.9.1
List of known extents (mostly countries of the world)
\new491 Added in version 4.9.1