Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all 2341 articles
Browse latest View live

Created Unassigned: MapWinGIS 4.9.3.6 OCX does not register on XP SP3 [26015]

$
0
0
I have just upgraded my development environment to 4.9.36 using the MapWinGIS-only-v4.9.3.6-Win32.exe. I am running on XP SP3. The install ran without errors and also installed the VC++ 2013 redistributable.
MapWinGIS.ocx however did not register properly so I cannot use it in VB6. Did a complete uninstall, registry clean, and fresh install to no avail. I also tried it on another clean XP system - same problem. There must be some dependency that is not in the installer. Anyone else had the same problem? Or anything I can look for

New Post: OGR-MSSQL-Spatial and ReprojectLayersOnAdding ->AccessViolatonException

$
0
0
Hi All,

using GlobalSettings.ReprojectLayersonAdding with an OGR SpatialDatabase-Layer throws an ugly AccessViolationException.

Maybe I missed something?

Here is my code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim connectionString As String = "MSSQL:Server=DELL-4-2015\SQLEXPRESS12; Database=DBNAME; User Id=USERNAME;Password=PASSWORD;"
        Dim layer = New OgrLayer()
        If layer.OpenFromDatabase(connectionString, "plz_de") Then
            ' only layer handle for the first layer being added is returned
            Dim layerHandle As Integer = AxMap1.AddLayer(layer, True) 'Exception thrown here!!!
        Else
            Debug.WriteLine("Failed to open: " + layer.ErrorMsg(layer.LastErrorCode))
        End If
 End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        AxMap1.Projection = tkMapProjection.PROJECTION_GOOGLE_MERCATOR
        AxMap1.TileProvider = tkTileProvider.OpenStreetMap
        AxMap1.KnownExtents = tkKnownExtents.keGermany
        Dim gs As New GlobalSettings
        gs.ReprojectLayersOnAdding = True
    End Sub
I'm using a fresh installed 4.9.3 with VS2013 and MSSQL2012SP2 on a WIN7/64 machine.
Any suggestions welcome.

Cheers
Burkhart

New Post: OGR-MSSQL-Spatial and ReprojectLayersOnAdding ->AccessViolatonException

$
0
0
Adding a shapefile to the map with reprojection works so far...
but trying to change the DrawingOptions of the reprojected shapefile fails (it seems the DefaultDrawingOptions are ignored).

Changing all datasources to the same projection everything works fine.

Cheers
Burkhart

EDIT: Okay, I've got that. Understanding reprojection helps...
If the layer is reprojected while adding, it is in fact a copy of the original shapefile in memory...

But the MSSQL-problem is still open.

New Post: OGR-MSSQL-Spatial and ReprojectLayersOnAdding ->AccessViolatonException

$
0
0
Hi Burkhart, I've just checked the code below with my current version (dev494 branch) and it worked:
string connection = @"MSSQL:server=.\;database=spatial;trusted_connection=yes";

var layer = new OgrLayer();
if (layer.OpenFromDatabase(connection, "buildings"))
{
    axMap1.AddLayer(layer, true);
}
For now I can't suggesting anything but to try it with different parameters (database, layers, etc.) to narrow down the problem.

New Post: OGR-MSSQL-Spatial and ReprojectLayersOnAdding ->AccessViolatonException

$
0
0
Hi Sergej,

thank you for your fast reply.

I'm stuck. I always get the AccessViolationException whenever the map is set to reprojectlayersonadd.
I checked the SRIDs of the spatial table, comes otu to 4326 which is quite right for wgs84.
I checked the feature count after open (layer.featurcount) which brings a correct number of features. So I think my connectionstring is correct (the data loads into wgs84 if ReprojectLayeronAdding is false).

I even tried testdata in UTM (so it is geometry not geography). Same thing happening.
I've tried another server (SQL-Server 2008). Same procedure.

Converting all data to pseudo mercator is no option.

What else can i check/test?
Any ideas?

Cheers
Burkhart

The complete exception stack is here:
System.AccessViolationException wurde nicht behandelt.
  HResult=-2147467261
  Message=Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.
  Source=mscorlib
  StackTrace:
       bei System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
       bei MapWinGIS._DMap.AddLayer(Object Object, Boolean Visible)
       bei AxMapWinGIS.AxMap.AddLayer(Object object, Boolean visible)
       bei MapWinGIS_Test.Form1.Button1_Click(Object sender, EventArgs e) in C:\Entwicklung\VS\MapWinGIS_Test\MapWinGIS_Test\Form1.vb:Zeile 16.
       bei System.Windows.Forms.Control.OnClick(EventArgs e)
       bei System.Windows.Forms.Button.OnClick(EventArgs e)
       bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       bei System.Windows.Forms.Control.WndProc(Message& m)
       bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
       bei System.Windows.Forms.Button.WndProc(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.Run(ApplicationContext context)
       bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       bei MapWinGIS_Test.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

New Post: OGR-MSSQL-Spatial and ReprojectLayersOnAdding ->AccessViolatonException

$
0
0
Digging further into this problem (maybe)...

Using QGIS I can access all spatial data on the server(s).

Now I've installed the latest MapWindow 5 and trying to connect I get a working connection but no databases layers are found!!
I'm clueless to this.
Maybe there is some 'metadata' on the server missinG? I've just tables with geometry or geograph columns (and tables with none-spatial-data) besides the standard system tables...

Still without any clue...

Cheers
Burkhart

New Post: OGR-MSSQL-Spatial and ReprojectLayersOnAdding ->AccessViolatonException

$
0
0
Importing a WGS-Shapefile to MSSQL via Mawindow5 results in a spatial table of geometry type, even if the srid is 4326 which should be geography. Such a layer throws the same exception as any other.

Loading a spatial layer with web mercator projection (with mapwingis) works like a charm.
So there seems to be something wrong with the reprojection (here).

Cheers
Burkhart

New Post: OGR-MSSQL-Spatial and ReprojectLayersOnAdding ->AccessViolatonException

$
0
0
Maybe it's possible to have a workaround?
Maybe I can load the data from the ogrlayer into a in-memory-shapefile and load the shapefile to the map?
Didnt't find a clever way yet.
Any recommendations?

Cheers
Burkhart

Created Unassigned: Saving of shapefile doesn't save objects [26016]

$
0
0
Just downloaded and installed MapWinGIS-only-v4.9.3.6-Win32.exe on Windows 10 (1511) and used it in an MS-Access Form in an VBA-application i used with Version 4.9.3.5
The appliction generates custom shapes in a newly generated Shapefile. It worked with Version 4.9.3.5
, without any Problems but with Version 4.9.3.6 either <shapeobject>.StopEditingShapes or <shapeobject>.save erase all objects, and only save the properly generated dbf-File.
Before issuing StopEditingShapes or Save you can query the extents of the shapefile and get correct results, but afterwards all Extents-Measures are 0. Both operations result in TRUE and do not generate an Errormessage, also the Progress gets displayed via the callback-interface and Counts from 0 to 100%.

Edited Unassigned: Saving of shapefile doesn't save objects [26016]

$
0
0
Just downloaded and installed MapWinGIS-only-v4.9.3.6-Win32.exe on Windows 10 (1511) and used it in an MS-Access Form in an VBA-application i used with Version 4.9.3.5
The appliction generates custom shapes in a newly generated Shapefile. It worked with Version 4.9.3.5
, without any Problems but with Version 4.9.3.6 either <shapeobject>.StopEditingShapes or <shapeobject>.save erase all objects, and only save the properly generated dbf-File.
Before issuing StopEditingShapes or Save you can query the extents of the shapefile and get correct results, but afterwards all Extents-Measures are 0. Both operations result in TRUE and do not generate an Errormessage, also the Progress gets displayed via the callback-interface and Counts from 0 to 100%.

This happens only, if a <shapefileobject>.fastmode = false gets called before the <shapeobject>.StopEditingShapes(True,True) Statement.
- that was different in the Version before.

New Post: OGR DynamicLoading

$
0
0
Hi All,

trying to load a greater number of point geometries (20-100k) from an ogr-datasource.
Up to the default of ogrlayer.maxfeaturecount (50.000) this is no problem.

Trying to load more elements ends up with nothing (featurecount is given correct, but nothing shown on the map).
Already set layer.MaxFeatureCount = 100.000 and layer.DynamicLoading = False.
Also used GlobalSettings.OgrLayerMaxFeatureCount = 100.000 to no effort.

Any ideas?

Cheers
Burkhart

Created Unassigned: Labeling polygons on the layer [26017]

$
0
0
Решил использовать в своих разработках MapWinGIS. Очень нравится. Но для себя отметил существенные недостатки:
1. Если использовать подписи полигонов (например здания), то надписи расположены как попало, а не точно в центре прямоугольника, как например в QGIS.
2. Подписи линий не перемещаются динамически при перемещении карты.
Возможно ли в дальнейшем доработка такого функционала или исправление недостатков?
P.S. Если слой открывать не через Shapefile, а через OGR/GDAL - то скорость работы существенно возрастает.

I decided to use in development MapWinGIS. (Delphi 10) Very like. But for myself I noted significant shortcomings:
1. If you use a signature polygons (such as buildings), the inscription placed haphazardly, but not exactly in the center of the rectangle, as in QGIS.
2. Signatures lines do not move dynamically as you move the map.
Is it possible to further refinement of the functional or correcting deficiencies?
P.S. If the layer is not open through the Shapefile, and through OGR / GDAL - the speed increases significantly.

__MapWinGIS__
![Image](http://www.imageup.ru/img148/2311438/2015-12-27-00-27-30-mapwindows-gis-explorer-versiya-13031-kopiya.png)

__QGIS__
![Image](http://www.imageup.ru/img148/2311442/2015-12-27-00-28-23-qgis2121-lyon-kostanay.jpg)

New Post: WMS add layer

$
0
0
Hi i'm trying to load a wms layer to the new mapwingis but i can't make it work.

what i'm doing right now is the following
MapWinGIS.WmsLayer test = new MapWinGIS.WmsLayer();
        test.BaseUrl = "http://127.0.0.1:8080/geoserver/wms?";
        test.Epsg = 4326;
        test.Layers="usa:states";
        test.Format = "image/png";
        test.DoCaching = true;
       int a= axMap1.AddLayer(test, true);
hope you can help me

Created Unassigned: MS Access 2016 crash on AxMap.DrawLabel [26018]

$
0
0
I'm developing an application in MS Access 2016 using the MapWinGIS.ocx. My code is working reasonably well but I need to add some simple functionality (like adding labels to markers on the map).

My markers are created manually using the DrawWideCircleEx function inside a loop based on an Access recordset. The markers are drawn correctly on a layer added to the map. Immediately after drawing the marker I try to apply a label to it using the DrawLabel function. I've debugged the code and find that the DrawLabel function seems to crash Access - immediately.

I'm not absolutely sure this is the appropriate forum for asking for help or if anyone has encountered this problem, but any suggestion / help is greatly appreciated - and thanks in advance.

Here's a snippet of the code that's causing the crash.
The offending statement labelReturn = CountyMap.DrawLabel("Text", pX, pY, 0) is commented out for now.

Do While Not rst3.EOF
mapLat = rst3!D_LATITUDE
mapLon = rst3!D_LONGITUDE
markerSize = rst3!D_GTOTAL / 1000

xlate = CountyMap.DegreesToPixel(mapLon, mapLat, pX, pY)

If (xlate) Then
Select Case markerSize
Case Is >= 20
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 16, RGB(255, 0, 0), False, 2)
'labelReturn = CountyMap.DrawLabel("Text", pX, pY, 0)

Case Is >= 10
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 8, RGB(255, 0, 0), False, 2)

Case Else
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 4, RGB(255, 0, 0), False, 2)
End Select
Else
End If

rst3.MoveNext
Loop

Commented Unassigned: MS Access 2016 crash on AxMap.DrawLabel [26018]

$
0
0
I'm developing an application in MS Access 2016 using the MapWinGIS.ocx. My code is working reasonably well but I need to add some simple functionality (like adding labels to markers on the map).

My markers are created manually using the DrawWideCircleEx function inside a loop based on an Access recordset. The markers are drawn correctly on a layer added to the map. Immediately after drawing the marker I try to apply a label to it using the DrawLabel function. I've debugged the code and find that the DrawLabel function seems to crash Access - immediately.

I'm not absolutely sure this is the appropriate forum for asking for help or if anyone has encountered this problem, but any suggestion / help is greatly appreciated - and thanks in advance.

Here's a snippet of the code that's causing the crash.
The offending statement labelReturn = CountyMap.DrawLabel("Text", pX, pY, 0) is commented out for now.

Do While Not rst3.EOF
mapLat = rst3!D_LATITUDE
mapLon = rst3!D_LONGITUDE
markerSize = rst3!D_GTOTAL / 1000

xlate = CountyMap.DegreesToPixel(mapLon, mapLat, pX, pY)

If (xlate) Then
Select Case markerSize
Case Is >= 20
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 16, RGB(255, 0, 0), False, 2)
'labelReturn = CountyMap.DrawLabel("Text", pX, pY, 0)

Case Is >= 10
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 8, RGB(255, 0, 0), False, 2)

Case Else
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 4, RGB(255, 0, 0), False, 2)
End Select
Else
End If

rst3.MoveNext
Loop
Comments: I've found a thread to pull on - I don't believe I'm doing the coordinate conversions (lat/lon to pixels) correctly. Despite the markers being displayed in the verified correct positions, improperly handling projection and coordinate conversions seem to be what's causing MS Access to crash. Still investigating...

New Post: set_ShapeSelected

$
0
0
I'm trying to select a polygon in a shapefile. The following is the code I'm using, the first three lines work to identify the shape (based on coordinates) correctly. The 4th line generates a syntax error, and points to set_ShapeSelected as not being understood by the compiler. It is as if the function set_ShapeSelected doesn't exist. I'm using version 4.8.6 of the activex component in a VBA environment
    selectedLayerShapefile.BeginPointInShapefile
    targetShapeIndex = selectedLayerShapefile.PointInShapefile(ProjX, ProjY)
    selectedLayerShapefile.SelectNone
    selectedLayerShapefile.set_ShapeSelected(targetShapeIndex, true)

New Post: set_ShapeSelected

New Post: WMS add layer

New Post: Point Selected

$
0
0
Ok, I solved my selecting polygon issue (from yesterday), and now I'm embarking on a similar one. I have a point layer, where I use custom icons (bitmaps) to display information about the points. If I select one of these point the way it works now, the bitmap goes away, I'd rather highlight it or enlarge it or something. Anyone have any pointers on how to go about this? Here's a screen capture showing the iconography: Image

Commented Unassigned: MS Access 2016 crash on AxMap.DrawLabel [26018]

$
0
0
I'm developing an application in MS Access 2016 using the MapWinGIS.ocx. My code is working reasonably well but I need to add some simple functionality (like adding labels to markers on the map).

My markers are created manually using the DrawWideCircleEx function inside a loop based on an Access recordset. The markers are drawn correctly on a layer added to the map. Immediately after drawing the marker I try to apply a label to it using the DrawLabel function. I've debugged the code and find that the DrawLabel function seems to crash Access - immediately.

I'm not absolutely sure this is the appropriate forum for asking for help or if anyone has encountered this problem, but any suggestion / help is greatly appreciated - and thanks in advance.

Here's a snippet of the code that's causing the crash.
The offending statement labelReturn = CountyMap.DrawLabel("Text", pX, pY, 0) is commented out for now.

Do While Not rst3.EOF
mapLat = rst3!D_LATITUDE
mapLon = rst3!D_LONGITUDE
markerSize = rst3!D_GTOTAL / 1000

xlate = CountyMap.DegreesToPixel(mapLon, mapLat, pX, pY)

If (xlate) Then
Select Case markerSize
Case Is >= 20
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 16, RGB(255, 0, 0), False, 2)
'labelReturn = CountyMap.DrawLabel("Text", pX, pY, 0)

Case Is >= 10
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 8, RGB(255, 0, 0), False, 2)

Case Else
markerSize = CountyMap.DrawWideCircleEx(hndDrawLayer, pX, pY, 4, RGB(255, 0, 0), False, 2)
End Select
Else
End If

rst3.MoveNext
Loop
Comments: After spending the day experimenting and searching for clues I still can't get the DrawLabel() function to work. Any assistance would be greatly appreciated.
Viewing all 2341 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>