Git Product home page Git Product logo

mapwindow / mapwingis Goto Github PK

View Code? Open in Web Editor NEW
266.0 47.0 134.0 339.43 MB

MapWinGIS.ocx is a FREE and OPEN SOURCE C++ based geographic information system programming ActiveX Control and application programmer interface (API) that can be added to a Windows Form in Visual Basic, C#, Delphi, or other languages that support ActiveX, providing your app with a map. Go to our forum for questions and help:

Home Page: https://mapwindow.discourse.group/

License: Mozilla Public License 2.0

C# 4.64% C++ 55.79% C 35.63% Batchfile 0.04% HTML 0.39% Makefile 0.24% Inno Setup 0.46% Clarion 0.01% Pascal 0.07% M4 0.02% Shell 2.03% CMake 0.18% CSS 0.04% Rich Text Format 0.34% PowerShell 0.14%

mapwingis's Introduction

What is MapWinGIS?

MapWinGIS.ocx is used to provide GIS and mapping functionality to any Windows Forms based application.

MapWinGIS.ocx is a FREE and OPEN SOURCE C++ based geographic information system programming ActiveX Control and application programmer interface (API) that can be added to a Windows Form in Visual Basic, C#, Delphi, or other languages that support ActiveX, providing your app with a map.

Github badges

MSBuild MapWinGIS+Gdal3

Who is Working on MapWinGIS?

The MapWinGIS Activex Control is a central product of the MapWindow GIS Open Source Project. The control is built entirely in C++ and is a robust and powerful GIS component that serves as the primary element of the MapWindow GIS Desktop Application and provides GIS functionality to many other software applications.

Can I Use MapWinGIS?

MapWinGIS.ocx is FREE and OPEN SOURCE under the MPL 2.0 license. This means that you can use it freely in your commercial and non-commercial applications.

How can I help?

MapWinGIS is very robust and well established - with several thousand downloads from the MapWindow.org web site over the past several years. MapWinGIS still has potential for many new and interesting upgrades and improvements. We are actively seeking developers who want to work on this project with us. Needed skills are C++ and/or C#.

Forum

We have an active community for questions about MapWindow5 and MapWinGIS. The forum is available at https://mapwindow.discourse.group/

mapwingis's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapwingis's Issues

Layer position

I've posted this issue on codeplex which might be abandoned... My apologies for creating redundant posts.

I'm experiencing strange positioning of shapefiles when adding them into MapWinGIS (AxMap) component: When adding the point shapefile, the new one is added below the previous one but the position number (get_LayerPosition) of the newly added layer is higher then position number of the previous one. When adding polyline or polygon shapefile, everything seems to work properly (new layers overlay the older ones, position number increases). Am I doing something wrong or is there some reason for such behavior?

Thank you,
Jiri

Here is my code snippet for adding new layer:

Private Sub tsmiAddLyr_Click(sender As Object, e As EventArgs) Handles tsmiAddLyr.Click
    OpenFileDialog1.Filter = "Shapefiles (*.shp)|*.shp"
    OpenFileDialog1.FileName = ""
    If OpenFileDialog1.ShowDialog = DialogResult.OK Then
        Dim sf = New Shapefile()
        If Not sf.Open(OpenFileDialog1.FileName) Then
            MessageBox.Show("Failed to open shapefile: " + sf.ErrorMsg(sf.LastErrorCode))
        Else
            Dim layerHandle As Integer = AxMap1.AddLayer(sf, True)
            Dim it As New ListViewItem(AxMap1.get_LayerPosition(layerHandle))
            it.SubItems.Add(AxMap1.get_LayerName(layerHandle))
            it.SubItems.Add(layerHandle)
            it.SubItems.Add(0)
            it.Checked = True
            lvLegend.Items.Add(it)

        End If
    End If
End Sub

Visual Studio 2015, MapWinGIS 4.9.4.2 Win32

Labels.Serialize() crashes on 4.9.4.0 or higher

After installing MapWinGIS 4.9.4.0 or 4.9.4.2 the Labels.Serialize() function give a AccessViolationExpection error:

An unhandled exception of type 'System.AccessViolationException' occurred

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

This code executes as expected in 4.3.9.5 but fails on later releases.

sf = pMapImage.AxMap1.get_Shapefile(iHandle)
Dim xmlLabelInfo As String = sf.Labels.Serialize()

OgrLayer editing in VBA

Hello
Where I can find some examples of using shape editing on an OGR Layer in VBA (for Access) please ? I found some stuff on C++ but I don't manage to do the same thing in VBA...
Thank's
Guen

missing gdal_priv.h

Try to build solution, but got the following message in VS 2015:

Error C1083 Cannot open include file: 'gdal_priv.h': No such file or directory MapWinGIS C:\dev\github\MapWinGIS\src\Control\GlobalVars.h 8

Point Type Icon: Transparency

Hi,
I cannot apply an icon with a black background as a point type icon. The background becomes transparent.
Can someone please confirm this?
Thanks,
LT

Feature request: WMSLayers extra parameter in base URL

I have got my application working well against 2 WMS services. One of the issues I came across was that the 1 WMS system needed an extra parameter passed to it. So a GetCapabilities would look like this:

http://506CMR/WMS/wms.asp?WMS=WorldMap&WMTVER=1.0.0&REQUEST=GetCapabilities

I needed the WMS=WorldMap parameter passed always. There is no way to do this in the current version of MapWinGIS because the base URL is always appended with a "?" and then GetCapabilities or GetMap etc. Then you get 2x "?" in the URL that goes to the WMS and it fails. So currently the base URL cannot contain any parameters of its own.

As a suggestion why don't you check if there is already a "?" in the base URL and then if it is present then use a "&" with GetCapabilities or GetMap for the extra parameters. So then my base URL would be:

http://506CMR/WMS/wms.asp?WMS=WorldMap

Find leght from start of shape

I have a mousclickevent to find a shape (POLYLINE). I can find the shape and get the minX and minY (point(0).x and point(0).y).

Now i whant to calculate the lengt of the shape until where my mouseclick is (e.x and e.y).

How can this be done?

Resizing map causes memory leak

Hi, I'm using ocx v4.9.4.2.

Recently noticed big spikes in memory when resizing. I've reproduced this using MapWindow5.
Saw same issue reported here: https://mapwingis.codeplex.com/discussions/659779 and I've posted a follow-up to the original post.

I am building the ocx from source but have not yet investigated. Hoping it is a known issue with a known fix.

Thanks,
link

axMap.DrawLabel problem

From @jan-sv on September 12, 2017 9:42

Form1.cs.txt
error1
I am using precompiled MapWinGis version 4.9.4.2 with Delphi7, Vs2013 VB and VS2013 C#
I have attached C# example
When I comment line with DrawLabel statement , all is Ok. when uncomment this line, project crashes.

Copied from original issue: MapWindow/MapWindow5#16

New installer for MapWinGIS.

Yesterday I created a new installer for MapWinGIS.
Please try it. Get if from https://github.com/MapWindow/MapWinGIS/releases

If you run into trouble you can post it here. We'll try to get back to you as soon as possible.

For the next few weeks we'll be working on updating the documentation and after that, we'll work on creating a new version of MapWindow5.

Couldn't compile MapWinGIS project with VS community 2015

Microsoft seems to discontinue the VS community 2013 software, hence I am trying to compile this project using the VS community 2015 software. I followed the instruction to use GDAL library from gisinternals.com, and did a couple of small changes in the Tools.h and TileManager.cpp, it got past compilation, but failed during linking with the following message:

Error	LNK2038	mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in DrawingRectangle.obj	MapWinGIS	C:\dev\github\MapWinGIS\src\SpatialIndex-mw.lib(DiskStorageManager.obj)	1

I think this is due to GDAL libs being compiled with VS2013 (1800), could we start petition to GDAL people to offer 1900 version of the libs? also could this project be updated to be compiled with VS2015?

Crashes when adding labels (4.9.4.2)

After the following code is executed an unhandled exception of type 'System.AccessViolationException' occurres.

var labels = map.get_DrawingLabels(0);
labels.Clear();
labels.AddLabel("test label", 0, 0);
map.Redraw();

Edit: Seems to only happen on my machine and when running from visual studio

End select by polygon

How can I finish a selectbypolygon in VBA Access to have the event SelectBoxFinal ? It work's with cmSelection but I don't find the good way to use SelectByPolygon (I tried right click, CTRL+click...no success...) Thank's a lot.

Non-square image does not centre on map correctly

I load a symbol image like this:

sf2.DefaultDrawingOptions.AlignPictureByBottom = False option
Set CT = sf2.Categories.Add("Base Station")
CT.DrawingOptions.PointType = ptSymbolPicture
Set img = New MapWinGIS.Image
img.Open App.Path & "\Layers\Base Station.png", , True
CT.DrawingOptions.Picture = img

The PNG image is 60 pixels wide and 85 pixels high. When it loads the image with CT.DrawingOptions.Picture then in the img properties the height and width are swapped around. This causes the image not to be centered on its mass when its is later placed on the map.

Here you can see the 2 values swapped around.

image

The img.extents seems to be correct:

image

Obviously the workaround is to make sure one has a square image and not a rectangular one.

Compiler Warning in Visual Studio 2017- C#

Hi there,
I'm trying to run a project in C#(Visual Studio 2017) with MapWinGIS v4.9.4.2. The project seems to work correctly, but I have several instances of the following warning:

Processing COM reference "MapWinGIS" from path "C:\dev\MapWinGIS\MapWinGIS.ocx". At least one of the arguments for 'IShapeDrawingOptions.DrawRectangle' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.

Thanks,
Tolga

Cannot merge two PointM shapefiles

Hi,

I'm trying to merge 2 simple points shapefile. The shapefiles are of type "PointM". I've attached a ZIP file containing the same dataset but in PointM format and Point format. PointM_vs_Point.zip

The merge works well with the Point format, but crashes with the PointM format. The error is:

An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Here's the code I run inside a C# console application. You can use the shapefiles provided with this post to replicate.

string shp1 = @"C:\Users\kevin.cote\Desktop\DATASET\shp1_point_m\SHP1_POINT_M.shp";
string shp2 = @"C:\Users\kevin.cote\Desktop\DATASET\shp2_point_m\SHP2_POINT_M.shp";
//string shp1 = @"C:\Users\kevin.cote\Desktop\DATASET\shp3_point\SHP3_POINT.shp";
//string shp2 = @"C:\Users\kevin.cote\Desktop\DATASET\shp4_point\SHP4_POINT.shp";

string output = @"C:\Users\kevin.cote\Desktop\DATASET\output\output.shp";

Shapefile sf_shp1 = new Shapefile();
sf_shp1.Resource(shp1);

Shapefile sf_shp2 = new Shapefile();
sf_shp2.Resource(shp2);

Shapefile new_sf = sf_shp1.Merge(false, sf_shp2, false);
new_sf.SaveAs(output);

What is causing this error ?

PointInShapefile

PointInShapefile(X,Y) returns a number which indicates the index of shapes within which a test point is situated. This appears to return a single index. How can I determine if the X,Y point falls within more than one shape?

Selection

Hello!
I want to selection objects on the map with a polygon, but I do not get anything.
If I do tkCursorMode.cmSelection - then everything works.

            Map.CursorMode = MapWinGIS.tkCursorMode.cmSelection;
            Map.SendSelectBoxFinal = true;

tkCursorMode.cmSelectByPolygon - it does not work for me.
How can I do it?
Thank you!

TilesAreInCache cant find?

Downloaded the latest version but i cant use this? Is there any other way to tell if the tile is loaded?

DrawLabelEx causes System.AccessViolationException

I have the following Code that causes an Uhandled Exception on the Map_Nav.Refresh() (VS2015)

Dim Map_Nav as new AxMap
Map_Wind_Handle = Map_Nav.NewDrawing(tkDrawReferenceList.dlScreenReferencedList)
Map_Nav.DrawLabelEx(Map_Wind_Handle, "Wind: 150/30", ox2, oy2, 90)
Map_Nav.refresh()

(ox2, oy2 are screen coordinates that are in the current Map Window)

Error issues by VS2015:

An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I am totally stuck .. Is there something I am missing?

UTF-8 Encoded Labels

I just posted same query on CodePlex - reposting here as I am unsure if that forum is active. Apologies for duplication.

I see here evidence of unicode support in labels here; however we cannot get them displayed properly on a map.

We would like to know the current support and limitations for UTF-8 encoded labels in MapWinGIS 4.9.4.2.

Thanks in advance.

Building MapWinGIS with Visual Studio 2015

I just successfully built a 64 bit MapWinGIS.ocx with Visual Studio 2015 and was able to register it. Is there an updated set of documentation of how to do this.... Specifically I'm not sure I got all the gdal dependencies. Seems like everyone that does build gdal does so with their specific needs. I built it with curl, geos, libjpeg, libpng, tiff, and zlib. Not sure this is sufficient for all MapWindow supported file formats. I also downloaded and/or built everything in the C:\dev\MapWinGIS\support\build\HowToBuild.txt. If there is not an update document, I'll look at building something. I was hoping to CMake everything but not every project provides CMake support. Thank you.

New Polygons not rendered after saving.

BLK_N.zip
When I create a new polygon in a shapefile using the ShapeEditor tool the new shape is visible after saving the file using using the Shapefile.Save() function. When the file is reloaded the polygons are not displayed and the Shapefile.ShapeRendered value is false, they are not set as Hidden and the Visible property is True as well. Enabling InteractiveEditing will render the new shapes but after reloading the file again they are not rendered. Opening the shapefile in MapWindow5 the new shapes are not rendered until InteractiveEditing is enabled. After saving the file from MapWindow5 the shapes will render correctly.

I am opening the shapefiles using the .Open function
Dim sf as New MapWinGIS.Shapefile
sf.Open(sFileName)

I am saving the file using the .Save function
Dim sf As Shapefile = AxMap1.get_Shapefile(iEditingLayer)
AxMap1.ShapeEditor.SaveChanges()
Dim bSaveResult As Boolean = sf.Save()

        If bSaveResult = False Then
            MsgBox(sf.ErrorMsg(sf.LastErrorCode))
        End If

No error is returned.

In the attached file ShapeID 1699 will not render until InteractiveEditing is enabled.

Thanks for your help on my issues.

Just upgraded from 4.8 and my shape files don't draw anymore... any ideas?

I use a custom base map from a TIFF file and then overlay it with a couple of layers that are SHP_POINT shape files. The shape files are not rendering, but if I do a ZoomToMaxVisibleExtents() on the layer it will correctly zoom to the extents of the objects in the shape file for the layer even though I cannot see them. Any help would be hugely appreciated! I'd hate to have to fall back to 4.8 since this has many nice new features!

Here is my code for adding the shape file layers:

			Shapefile sf = new Shapefile();
			sf.CreateNewWithShapeID("", ShpfileType.SHP_POINT);

			// Add Name attribute
			sf.StartEditingShapes(true, null);
			Field name = new Field() { Name = "Name", Type = FieldType.STRING_FIELD, Width = 20 };
			int nameIndex = sf.NumFields;
			sf.EditInsertField(name, ref nameIndex, null);
			sf.StopEditingShapes(true, true, null);

			// creating points and inserting them in the shape
			sf.StartEditingShapes(false, null);
			foreach (MapEquipmentDef well in layerDef.Equipment.Values)
			{
				MapWinGIS.Point pnt = new MapWinGIS.Point() { x = well.X, y = well.Y };

				Shape shp = new Shape();
				shp.Create(ShpfileType.SHP_POINT);

				int index = 0;
				shp.InsertPoint(pnt, ref index);

				int shpIndex = sf.NumShapes;
				sf.EditInsertShape(shp, ref shpIndex);
				sf.EditCellValue(nameIndex, shpIndex, well.DisplayName);

				well.LayerIdx = axMap1.NumLayers;
				well.ShapeIdx = shpIndex;
			}
			sf.Labels.Alignment = tkLabelAlignment.laBottomCenter;
			sf.Labels.AutoOffset = true;
			sf.Labels.AvoidCollisions = true;
			sf.Labels.FontBold = true;
			sf.Labels.FontSize = 9;
			sf.Labels.FontColor = Convert.ToUInt32(ColorTranslator.ToOle(layerDef.LabelColor));
			sf.Labels.FrameVisible = false;
			sf.GenerateLabels(nameIndex, tkLabelPositioning.lpCenter, false);

			sf.StopEditingShapes(true, true, null);

			sf.DefaultDrawingOptions.SetDefaultPointSymbol(layerDef.Symbol);
			sf.DefaultDrawingOptions.PointSize = layerDef.SymbolSize;
			sf.DefaultDrawingOptions.LineColor = Convert.ToUInt32(ColorTranslator.ToOle(Color.Black)); 
            sf.DefaultDrawingOptions.FillColor = Convert.ToUInt32(ColorTranslator.ToOle(layerDef.SymbolColor));
            sf.FastMode = true;

			// adds shapefile to the map
			layerDef.LayerIdx = axMap1.AddLayer(sf, true);
			axMap1.set_LayerName(layerDef.LayerIdx, layerDef.LayerName);
			axMap1.set_LayerVisible(layerDef.LayerIdx, true);

Mousedown/up-event -> selecting shape (VBA/Access2000)

Hello there.
Im trying to find out how to select a shape via mouseclick. Actually i decided to use the Mouseup-Event - but now im stuck in transferring the coordinates to the void AxMap.PixelToProj (I'm not even sure that this is the right way).
Anyway - with Private Sub Karte1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long) i get the mouseposition in relation to the control's origin ("[...] coordinate of mouse cursor position in pixels relative to control's origin.") as a long integer.
To doAxMap.PixelToProj i need to input a double of some other source then quoted about.

Someone could give me tip how i could solve this better?

This is the whole code of my Sub (which doesnt work ;)):
(

Private Sub Karte1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long) 
  Dim sf As MapWinGIS.Shapefile
  Dim i As Integer
  Dim Pixx, Pixy, Prox, Proy As Double
  
  Set sf = Form_frm_MOtest.Karte1.Shapefile(0)
  Pixx = CDbl(x)
  Pixy = CDbl(y)
  
  Debug.Print ("Pixx=" & Pixx & "/" & "Pixy=" & Pixy)
  
  If Karte1.CursorMode = tkCursorMode.cmSelection Then
    Debug.Print (Button & " " & Shift & " " & x & " " & y)  '<-this one works
    Call Karte1.PixelToProj(Pixx, Pixy, Prox, Proy)
    Debug.Print (Prox & "/" & Proy)
      'If sf.PointInShapefile(x, y) = True Then
      
     ' End If
  End If
  'Call ZoomToShapeByClick
End Sub

the ordinal 4445 not found in the DLL libcurl.dll

Thank You for the excellent components. Help to fix the failure.
Previously I used the version 4.8.8. when migrating to version 4.9.4.2 began to receive the error. "the ordinal 4445 not found in the DLL libcurl.dll"

Labels or Legend for uniquevalues in Categories/scheme colour

Good afternoon everyone:
I am using the latest version of Mapwingis with VBA, to represent polygon in regions with different colors, with the help of Categories and Schemas. As these zones correspond to shapes that are all together, they appear well differentiated with their color.

This code works:
X= OBJETO.AddLayerFromDatabase("PARCELAS.DBF", "SELECT * FROM PARCELAS", True)
OBJETO.LayerName(CAPA) = "PARCELARIO"
Set SF = Visor.Shapefile(CAPA)
SF.DefaultDrawingOptions.FillType = ftStandard
SF.Categories.Generate 2, ctUniqueValues, 0
SF.Categories.ApplyExpressions
SF.Labels.GenerateCategories 2, ctUniqueValues, 0
Set esquema = New ColorScheme
esquema.SetColors2 tkMapColor.Yellow, tkMapColor.red
SF.Categories.ApplyColorScheme tkColorSchemeType.ctSchemeGraduated, esquema

categories
1- I need to generate labels, and to be able to put the name of the zone (value of field nº2) in the center of each one, I mean, to put in a unique name of the colored zones. A single label for each category,

2- Another alternative that the state tries to implement is to use a legend, but I do not know if it is possible to make it compatible with the application of categories.

I am new to this and would appreciate a lot of guidance on the issues, since I work in VBA and it is not easy for me to get examples with code.

Thank you very much in advance, and excuse my English.

Angel

problem of axMap.ClearDrawing(int drawHandle)

in documention given by http://www.mapwindow.org/documentation/mapwingis4.9/class_ax_map.html, the correct action of method axMap.CleartDrawing(int drawHandle) is clear drawings on the layer with the given handle and the drawing layer keeps. However, actually when the method is invoked, the drawing layer with the drawHandle will be deleted. I couldn't go on drawing on the same layer. In some condition, I need the layer keeps all the time even i delete the drawings on the layer. How can me solve the problem? thank you

Multipolygon will exchange to polygon

I create shape, then importfromwkt. This is a multipolygon. But after import to shape, the multipolygon will exchange to polygon. I debug the code, I found the code in OgrConverter::GeometryToShape method:
for(long iRing = 0; iRing < nRings; iRing++ )
{
oRing = papoRings[iRing];

		long ringPointsCount = oRing->getNumPoints();
		
		if (ringPointsCount > 0)
		{
			shp->InsertPart(count, &iRing, &retval);

			for (long i = 0; i < ringPointsCount; i++)
			{
				ComHelper::CreatePoint(&pnt);
				pnt->put_X(oRing->getX(i));
				pnt->put_Y(oRing->getY(i));
				if (isM)	pnt->put_M(oRing->getZ(i));
				else		pnt->put_Z(oRing->getZ(i));
				shp->InsertPoint(pnt, &count, &retval);
				pnt->Release();
				pnt = NULL;
				if (retval)
					count++;
			}
		}
	}

when I use release mode compile, "if (ringPointsCount > 0) "pass, but " for (long i = 0; i < ringPointsCount; i++)" can't run to "ComHelper::CreatePoint(&pnt);"
it is strange!
when I use debug mode compile ,It debug correct!

Maybe I ignore something important???

Documentation files not available?

I can't find documentation files for MapWinGIS. I would also like to see new features and fixes for the latest release. I have tried the web site, CodePlex, and don't see anything on GitHub. Where should I look for information/discussion.

error MSB8011: Failed to register output

I try to build mapwingis ocx follow vid 'MW5+MapWinGIS Build' (https://www.youtube.com/watch?v=WVQaFsil0bY). But I got problem during building process (vs2013, admin mode)

Error 4 error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets
1620 5 MapWinGIS.

So, I try to solve as below.

  1. Run visual studio in administrator mode.
  2. Change another computer.
  3. Change windows (10 and 7).
  4. Try other visual studio version (2017,2015 with matched gdal).
  5. Disable user account control (Local security policy => Security options => User Account control : Run all administrator.... )

All these actions still getting the same error. So I try to skip ocx register by changed a properties (Linker => Register output => No). Then, I can built but fail on manual register. Pls help what I'm doing wrong, thanks.

here is screenshot
https://ibb.co/n45s3R
https://ibb.co/cvH5OR
https://ibb.co/mwBocm

Point Image Serialization - Shapefiles

There appears to be a bug in image serialization - or deserialization.

I can apply an image to a point shape. I am using a png, so it is not serializing as GdiPlus. Put/Get Image API works fine. However after I save the layer and then re-load it, 3/4 of the image is black. Perhaps this has to do with the alpha channel? Perhaps with base64 encoding/decoding?

TIA,
LT

Selecting Shapes (Access2000/VBA)

Hi there,

Im actually developing an interactive map in combination with an existing database/table. Im sorry i have to say that im still learning VBA - but i would really appreciate some help.
I made it that i can choose some shapefile to load into the map. Im able to label features and change the layout. Furthermore its possible to go through the linked Recordsets and autozoom to the corresponding shape.

What i now want to do is

  • select a shape (and change the layout of selected one)
  • jump to the corresponding record of the table (which is datasource of the form)

I did not figure out how to select a shape via mouseclick. Changing the Cursormode to cmSelection seems to be not enough (Im able to select all shapes via code (Form_frm_MOtest.Karte1.GetObject(0).SelectAll).

Access gives me a MouseDown and MouseUp options for an interaction with mouse, but a messagebox does not appear with following code:

Private Sub Karte1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
 MsgBox("Halleluja")

Well but nothing happens there when im clicking. When im using Private Sub Karte1_DblClick() the messagebox appears, but i dont have variables to work with...

Cannot Install Into Delphi XE7

I would like to try out MapWinGIS in my Delphi Application as a replacement for ESRI MapObjects which is no longer supported (and is only 32 bit). I need a system that can be embedded in a 32 and 64 bit Windows application. MapWinGIS seems to fit the bill in theory, but I am unable to get it installed properly into Delphi (I am using Delphi XE7). I have installed MapWinGIS OK into Windows 7 (4.9.4.2) but when I try to use the Delphi Import Component/Import ActiveX Control and then Add the MapWinGIS.ocx component I see this error message.

Error Loading Type Library/DLL (80029C)

A similar problem has been logged here: http://qc.embarcadero.com/wc/qcmain.aspx?d=103653
Does anyone have any suggestions on how to get MapWinGIS properly working with Delphi?
Thanks in advance!

Change FillColor Shape in VBA

All,

I use Excel and VBA with the latest version of MapWinGIS.

I like to show different shapes (cities, polygon regions) in different colors and at the same time I like to set the transparency of the fill color.
Although I can iterate through all shapes, I do not succeed in changing the FillColor of the different shapes, with different colors per shape. I tried almost everything I can imagine but with no success. I keep getting all sorts of error messages going from "needs object", to "method does not support this method".

  1. Methods like ShapeFillColor do not longer exist I think.
  2. solutions with ShapefileCategories block on the part when I want to add the category , e.g. "ctOrange = sf.Categories.Add(strOrange)"
  3. I even forgot the last one ;)

Does anyone have an idea what I am doing wrong? Or even better, does anyone have an example how this can work?

Kind regards
Mark

Russian is not supported

Hello! Sorry for my English. Do you speak Russian?
I'm trying to create labels on the map from my Shapefile, but it turned out that the encoding of the Russian language is not supported.
It is also not possible to create character categories by attribute from the database.
Did this:
var gs = new GlobalSettings(); gs.OgrStringEncoding = tkOgrEncoding.oseUtf8;
The result did not.
What can I do?

Black image with Big Tiff file

Thank You for the excellent components. Please help me to fix this issue.

I had a Tiff file, about 468mb,
https://drive.google.com/file/d/0B8Q2ZOp7YgmHZ3VrOUFYSFZfb2c/view?usp=sharing

I opened it with MapWindow-v5.1.1.28898 x86 MapWinGIS 4.9.4.2, the tif Image just show black
https://drive.google.com/file/d/0B8Q2ZOp7YgmHa1lQS2VnZW9sR0E/view?usp=sharing (height 187m)

when I zoomed it in several times, it can show the Image
https://drive.google.com/file/d/0B8Q2ZOp7YgmHeUM4MEFZaEQ4ZEE/view?usp=sharing (height 20m)

I debuged into the MapWinGIS and I found that in the function GdalRaster::ReadBandData:
poBand->AdviseRead(xOffset, yOffset, width, height, xBuff, yBuff, GDT_Byte, NULL);
poBand->RasterIO(GF_Read, xOffset, yOffset, width, height, srcDataChar, xBuff, yBuff, GDT_Byte, 0, 0);
RasterIO function can not read any data to srcDataChar at 187m but at 20m it can

I dont know how to fix this problem, if you have any idea to fix this, plz help me, thank you so much!

Image reprojection

Hi All,

Can MapWinGIS overlay layers with different CRS? I found that I can reproject each vector layer from its original CRS (usually stored in prj file) to some common CRS (ie. "Pseudo-Mercator") before depicting them in my map window. My problem is that I have not found the reprojecting feature for rasters. Does anybody know some algorithm or procedure how to reproject rasters in MapWinGIS?

Thank you,
Jiri

display a map from a sqlite data base

hi guys!
thank you for the great work that you are doing.
am trying to display a map by using ogr from sqlite database file with no success.
can you please post a full example how to do it
thank you

Drawing on a Drawing Layer that has been removed does not generate an error

I have this code

Dim Map_Nav As New AxMap
Map_Wind_Handle = Map_Nav.NewDrawing(tkDrawReferenceList.dlScreenReferencedList)
Dim utils As New Utils
Map_Nav.DrawLineEx(Map_Wind_Handle, 400, 400, 500, 500, 10, utils.ColorByName(tkMapColor.Blue))
Map_Nav.MoveLayerTop(Map_Wind_Handle)
Map_Nav.Refresh()
Map_Nav.Redraw()

The info for the window is: - System.Drawing.Rectangle{X = 0 Y = 0 Width = 920 Height = 894}

The line refuses to show on the layer

Would really appreciate any help, the coordinates given do fall in the window bounds, IM sure Im missing something obvious .. but cannot see it ..

mousedown

ver 4.9.4.2 win 32 using Visual Foxpro 9.0 windows 7

with sendmousedown=true

event mousedown does not fire on left mouse click
mouse down does fire on right mouse click

with sendmouseup

event fires on mouse clicks, but if cursormode is set to 0, cursor icon changes as if in cursormode=1 but functions as in cursormode= 0

DrawLableEx dont work

Hello. I cant draw labels on my axmap. See codesnippet. The label wont apear on the map.

AxMap1.ClearDrawing(recept_punkt_lager)`
recept_punkt_lager = AxMap1.NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyReferencedList)
Dim e1 As Double = 65000.200
Dim n1 As Double  = 56000.300
AxMap1.DrawLabelEx(recept_punkt_lager, "Test", e1, n1, 0)

Shapefile Fast Mode

We are trying to use fast mode for in-memory shapefiles. We have implemented this via the GlobalSettings.

There is some strange behavior, however, as some of the layers' shapes disappear at certain zoom levels. It happens when zooming-in but can also occur when panning at those zoomed-in levels.

Hoping for any insight here. Thanks in advance.

As a follow-up question: does fast mode only offer advantages for editing shapes? as opposed to just large shapefiles?

error:MSB3073 when build the MapWinGIS

hello,i've done like the video on youtube with vs2013,GDAL 1800(x86 version),everything like the video,but the vs2013 shows the error
error MSB3073: command “if Win32 == Win32 setx MapWinGISBin32 E:\Administrator\Documents\Visual Studio 2013\Projects\MapWinGIS\src\bin\Win32\
if Win32 == x64 setx MapWinGISBin64 E:\Administrator\Documents\Visual Studio 2013\Projects\MapWinGIS\src\bin\Win32
:VCEnd” exits,code is 1。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 132 5 MapWinGIS

i use admin to open vs2013 and read the http://www.mapwindow.org/documentation/mapwindow5/compile.html
and set 'Register output' to No,it shows this error
if i set 'Register output' to YES,it shows "per-user ........"

so what's wrong with it?TKS

Legend control in VBA form for MapWinGIS 4.9.3: References?

Good afternoon:

I am trying to use the Legend control on a Microsoft Access 2007/2010 form. I try to add references of MapWinInterfaces.dll to the project, but it is not possible.

I wanted to know if there is any way to use in MapWinGIS 4.9.3, the Legend control (as in previous versions), and if not, some alternative formula to incorporate a similar operation to the example SplitByAttribute.cs, but that allows to mark and unmark Layers / selections.
Thank you very much, and best regards.

Ángel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.