ThinkGeo.com    |     Documentation    |     Premium Support

User machine errors when using NOAA Weather Warnings Feature Layer

Hello,

I am trying to add the NoaaWeatherWarningsFeatureLayer to our map. On my development machine, everything runs as expected. However, when our program is installed on a user’s machine, and they try to access the layer, we have issues. First, the layer does not appear. Then, as soon as the user moves their mouse, the following error occurs:

System.InvalidOperationException: The projection is not open. Please open it before calling this method.
at ThinkGeo.MapSuite.Core.Projection.ConvertToInternalProjection(RectangleShape rectangleShape)
at ThinkGeo.MapSuite.Core.FeatureSource.ConvertToInternalProjection(RectangleShape rectangle)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable1 returningColumnNames) at ThinkGeo.MapSuite.Core.FeatureLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas) at ThinkGeo.MapSuite.DesktopEdition.Overlay.4BQ=(GeoCanvas canvas) at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas) at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qRU=(IEnumerable1 drawingOverlays, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qBU=(RectangleShape drawingExtent, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.0hU=(IEnumerable`1 drawingOverlays)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.yRU=(RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.wBU=(InteractionArguments interactionArguments)
at ThinkGeo.MapSuite.DesktopEdition.MouseEventAnalyzer.OnMouseEvent(OxY= e)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.vxU=(Object sender, MouseEventArgs e)
at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

What could be happening on the user machine that is causing this? Why is it working on my development machine, but not user machines?

Thanks,
Dib

By the way, we are also seeing this with the NoaaRadarRasterLayer and the NoaaWeatherStationFeatureLayer. We have used the NoaaRadarRasterLayer with previous versions of our program, without any problems. This is a new issue, using the latest MapSuite 9.xx build.

I reported something similar a couple of weeks ago. The fix was including some merge modules in with our installer. Could this be similar?

Hi Dib,

I think that’s not similar, because this time your code works on your development machine but not on your user’
s machine.

For NoaaWeather related layer, that maybe related with the network reason, because that need directly connect to the NOAA server, in some of our test network, we need wait to get an image after one minutes. So maybe you want to test whether the target machine can connect to the server like: http://alerts.weather.gov/cap/us.php?x=0

And from your exception, it looks the exception message is “The projection is not open”, and I hadn’t found the NOAA related class from the detail information, so maybe that’s not related with this layer? But only because some other layer which hadn’t open the used projection?

I think if there are further information or test result which should be helpful.

Regards,

Don

Don,

Here is a different error message that we got on a non-dev machine. Again, everything work fine on our dev box.

************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: ptr
at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
at xRM=.AEY=.BEY=()
at xRM=.AEY=.DEY=(Bitmap bitmap, Double[] sourceWorldfileData, String sourceProjectionString, String targetProjectionString, Double[] targetWorldfileData)
at xRM=.AEY=.CEY=(Bitmap sourceBitmap, RectangleShape extent, String sourceProjectionString, String targetProjectionString, RectangleShape targetMinExtent)
at ThinkGeo.MapSuite.Core.ManagedProj4Projection.ConvertToExternalProjectionCore(GeoImage image, RectangleShape imageExtent)
at ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.RasterLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers)
at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.4BQ=(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qRU=(IEnumerable`1 drawingOverlays, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qBU=(RectangleShape drawingExtent, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.yRU=(RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.wxU=(InteractionArguments interactionArguments)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.tRU=(Object sender, OxY= e)
at ThinkGeo.MapSuite.DesktopEdition.MouseEventAnalyzer.OnMouseEvent(OxY= e)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.whU=(Object sender, MouseEventArgs e)
at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseWheel(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseWheel(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Our other problem that involved the merge modules also worked correctly on my dev machine, but did not work in the client’s machine until the merge modules were included in the build. That’s what made me think this could be the same issue, because both worked on the dev box but not on the client box.

Hopefully this error message will give you more info. Our map unit is set to meters, and again all the NOAA layers work fine on my dev machine.

Don,

For more info: We started noticing these errors when we updated to MapSuite build 9.0.612. Previously we had been using 9.0.515 and 9.0.142, which ran without any problems. We also changed the map from Decimal Degrees to Meters. However, the code to show the NOAA layers hasn’t changed at all, which is why I’m having ThinkGeo help track down the problem.

Hi Dib,

Thanks for let us know this, we need more time to research it.

Any update I will reply here.

Regards,

Don

Don, we may have traced part of the problem to needing the file GeoRasterProjectionWrapperX64.dll. I added it to our installer, in the directory it was supposed to be in (prog files\GeoRasterProjection), and now when one of these layers is turned on, we get this error:

Faulting application name: Hurrevac.exe, version: 1.7.0.1, time stamp: 0x58d2c55d
Faulting module name: ntdll.dll, version: 6.1.7601.23677, time stamp: 0x589c99e1
Exception code: 0xc0000374

Hi Dib,

If that’s related with unmanaged dlls, I think you can try to install our UnmanagedDependencies package to see whether that works.

I guess you still missed some dlls not only the GeoRasterProjectionWrapperX64.dll.

You should want to add the other dll like:
proj.dll
gdal19.dll
msvcp100d.dll
msvcr100d.dll
msvcp100.dll
msvcr100.dll

You can view that here: http://wiki.thinkgeo.com/wiki/map_suite_dependencies_guide_9.0.0.0

Wish that’s helpful.

Regards,

Don

Don,

Trying to add MapSuiteGeoRasterProjection.msm to out setup project, but it throws an error:

Unable to open merge module ‘…/Hurrevac2010/Merge Modules/MapSuiteGeoRasterProjection.msm’. Check to make sure the module language is correct. ‘The language of this installation package is not supported by your system. (Exception from HRESULT: 0x80070657)’

I guess my bigger question is why is this an issue now, where we were using the NOAA radar layer fine previously? Is it due to our changing the map unit to meters? Is it something in the latest 9.xx version of MapSuite? Why does it only happen on client machines? It seems strange that something that worked so well previously now is causing problems.

I know development doesn’t always make sense. Just hoping we can get thru theses issues quickly.

Thanks,
Dib

Hi Dib,

We hadn’t met the exception before, our developer just build the merge module like the other merge modules we have, the default language for it is en-us.

Could you please let us know when you get this exception? When you integrate that in your project or when you install that on your client’s machine?

If you get the exception when you install on your user’s machine, please let us know some information of your user’s, if you met that on your development machine, please give us some more detail steps for reproduce that.

Regards,

Don

Don,

The error happens when the layer tries to draw. I can create the layer and fire .StartMonitoring on it without a problem. If the layer .IsVisible is false, there are no problems. It only happens if the layer if visible, and it tries to draw for the first time.

Our program installs correctly, and all other aspects of it run without a problem. It is just the NOAA layers that cause an issue.

If you would like, I can get you our .MSI so you can run it yourself and see what info you can get from that.

Don,

Just a quick update and reset:

I fixed the language problem that wasn’t allowing me to add the merge module MapSuiteGeoRasterProjection.msm to our installer. We can now build with it.

However, after building with that module, and installing the program on my machine, turning on the NOAA radar layer now causes the same error on my machine as we are seeing on client machines. This occurs both when running the installed version, and when I am debugging in Visual Studio. The error info is listed above, and begins with:

System.ArgumentNullException: Value cannot be null. Parameter name: ptr
at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
at xRM=.AEY=.BEY=()

Even after uninstalling our program on my machine, this error still occurs.

The weather stations and weather warnings layers are still working correctly on my machine, both with the installed version, and through Visual Studio.

On the client machine, the weather stations and warnings layers are not working at all, and show the error message above starting with:

System.InvalidOperationException: The projection is not open. Please open it before calling this method.
at ThinkGeo.MapSuite.Core.Projection.ConvertToInternalProjection(RectangleShape rectangleShape)

We also see occasional errors when drawing items east of 180 that seem to have to do with our using unmanaged projections. We have to use unmanaged projections because none of the managed projections will draw past 180. This is something we can take up in another thread, but I just wanted to put out there as well.

Let me know what information I can get to you, and if you would like an .msi of our program.

Thanks,
Dib

Hi Dib,

It looks you copy the dlls to user’s machine, the error disappear, you install the dlls by merge module, the error appear.

So the problem still be the merge module hadn’t put the dll into target machine correct, right?

Could you please double check the dlls and see which dlls missed by merge module, if you found any dlls missed please let us know.

Regards,

Don

Don,

I will investigate and let you know. However, please note that once the MapSuiteGeoRasterProjection.msm module was installed on my development machine, the error with the NOAA radar layer now gets thrown. This layer worked on my development machine until that merge module was installed on it.

Don,

Looking at the client machine after install, the proj.dll and gdal19.dll files are not on that machine. I will work up a new installer with them to see if that makes a difference.

We also have a client machine that has our previous version (1.6 vs 1.7 that is currently in development.) On that machine, neither of these DLL files exist, yet the radar layer runs as expected. The 1.6 version was built using 9.0.107.0 version of ThinkGeo. Not sure if that info helps you or not.

Dib

Hi Dib,

Maybe that’s not helpful. Our problem is we cannot reproduce that even we test it in an clean machine.

So I guess whether the different dll is not only in the folders we watched, could you please build some Virtual Machine with the same OS just like your user’s and test your installer there?

If we think more possibility about that we will reply here.

Regards,

Don

Don,

I built a new Win 10 virtual machine. I built a new installer that did not include the MapSuiteGeoRasterProjection.msm. After installing the program on the new machine, turning on the radar layer throws this error:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: ptr
at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
at xRM=.AEY=.BEY=()
at xRM=.AEY=.DEY=(Bitmap bitmap, Double[] sourceWorldfileData, String sourceProjectionString, String targetProjectionString, Double[] targetWorldfileData)
at xRM=.AEY=.CEY=(Bitmap sourceBitmap, RectangleShape extent, String sourceProjectionString, String targetProjectionString, RectangleShape targetMinExtent)
at ThinkGeo.MapSuite.Core.ManagedProj4Projection.ConvertToExternalProjectionCore(GeoImage image, RectangleShape imageExtent)
at ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.RasterLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers)
at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.4BQ=(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qRU=(IEnumerable1 drawingOverlays, RectangleShape extent) at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.qBU=(RectangleShape drawingExtent, RectangleShape extent) at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.0hU=(IEnumerable1 drawingOverlays)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.yRU=(RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.wBU=(InteractionArguments interactionArguments)
at ThinkGeo.MapSuite.DesktopEdition.MouseEventAnalyzer.OnMouseEvent(OxY= e)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.vxU=(Object sender, MouseEventArgs e)
at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I also created a new project, set the map unit to meters, added 3 of our shapefiles, and then added the radar layer. The same thing happens there.

If you want or .msi, or to see any or our code, let me know.

Hi Dib,

In fact I still have a little confused about that, you mentioned “once the MapSuiteGeoRasterProjection.msm module was installed on my development machine, the error with the NOAA radar layer now gets thrown”, that means you integrate the msm still get exception, but your latest test didn’t add this merge module.

Please sent us your test msi so we can also reproduce that, if we get your installer, we can add the dll into test machine and see what missed there.

Regards,

Don

Don,

I can send you a link for our installers, but I would need to do so privately. How can I contact you?

Dib

Don, I have contacted Moritz, who will be forwarding you the link.