I have a desktop app in C# using GMap.NET and it's great, but my app must work without Internet. I thought, I needed kinda PostgreSQLProvider for GMap.NET.
So I downloaded an .osm file for Russian Federation, created a postgresql database with postGIS extention and then executed query, which was generated with osm2po (it's huge: 1,2 Gb)
Now I have a databese, which can be visualized with QGis. I want to visualize this database map in my C# application to handle user mouse button clicks and draw some objects on map.
How can I do that? Maybe I should use another framework? All I need from map is get placemarks in mouse button click handler function and draw objects on map.
You can prefetch the maps you want with the demo version of GMAP.NET. Then grab the database generated by the prefetch and use it in your application. its located in
C:\Users\USERNAME\AppData\Local\GMap.NET\TileDBv5\en\Data.gmdb
the Database is in SQLite but I figure you can convert it to any DBMS you want.
I found, where the problem in. osm2po generate for me vector map, but GMap visualize only raster. The solution is to use another framework, such as SharpMap, that can work with vector maps from database.
Of course, I can write my own PgSQLProvider for GMap, but I have only a month and still many other works.
Related
Im working with a 3rd party system where lots of settings are saved. These are typically single numbers, but in some cases can take the form of 1D or 2D tables. Within this system there is no versioning, backup, or history for the settings. Once you change a number you cannot revert your change, or look back what the number was 2 weeks ago. I am creating something to handle this.
The data could be described like this:
Var_A = {1}
Var_B = {3.4}
Table_A = {2,4.5,3,10}
Table_B = {{2,5,7}{3,8,1}{2,65,106}}
I have a simple c# console app where I am able to pull data from this system via a websocket interface and can display data in real time in the console, or write to a simple .txt log file. With a seperate app I can also send values back to the 3rd party system.
What I would like to acheive:
Save all values from the 3rd party system on demand to some sort of log/database
View historical values - A simple interface where I can jump through time and look back at historical values. Veiwing each complete timestep is fine for a first step, but an ultimate aim would be to be able to drill down into the history of invividual values, and be able to search for when certain values changed.
Send values back to the 3rd party system - both individual values and the entire record from any given 'save' time
All of this should be easy to deploy on a series of windows PCs without lots of external dependancies
What I need help with:
What should I look at to save the values? At most there will be in the order of several hundred 'saves' of around 50 variables per deployment - Not high frequency data. Can I use something like an .xml file? do I need a database, and if so what should I be considering with a priority on lightweight and easy to deploy?
What librarys and projects are out there to get me started on the historical data gui? Im sure what im trying to acheive has parallels elsewhere and someone out there has already done a far better job of this than I will starting completely from scratch. Im open to all options at this stage - wpf/winforms, browser based, or other. Im most comfortable with C# and the .net world and my existing code to import and export data is C# but I'm open to picking up other options if theres a really good solution elsewhere I can leverage.
I am new to asp.net and Google maps. I want to achieve tracking capability on my asp.net page. I want to create a number of markers and then move them along a path.
Can any one help me understand, how do I do it?
I want google maps to work as AJAX
this can be done in many ways, I will dish out a very easy solution,
1.Your webpage should load a map and add markers representing your assets with an id.
2. Your web page should ping your web server every sec to query for change
3. If your server has a change to report it should reply back with the latest latlon for those ids as a json
4.you can then update the positions of those markers.
If you can implement http push(long polling/websockets) then even better as you will get near realtime updates
This assumes that your web server is being updated by your tracking device.
your webservice should always return the latest position it has for the assets.
Updating your markers(assets) on client side is pretty easy as well,
To 'move' your existing marker, you'll wanna make sure its global and then you can just update its position within the function with something like:
marker.setPosition(results[0].geometry.location);
I'm new to development and particularly C#. Been thrown in the deep end here but learning quickly :)
I am developing a simple Mapping Web App in VS2008. I have the map window up and running in my form thanks to a web control supplied by Esri.
I now need to provide an address search facility on the form whereby the user can enter postocde, road name etc into boxes and the map window then zooms to this desired location.
I know this can be achieved using Google Maps addressing etc but I need to use an Address table from our database (ArcSDE). My boss has suggested using SQLDataReader in .net to achieve this? Our address table includes columns for road name, postcode etc and a X and Y for each record (points).
If you have the X Y for each record, you could just query the database for the supplied address (with SqlDataReader or any other kind of database access technology) and use that to zoom to the correct coordinates. Also, what API are you using for your map. I assume it's ESRI (i.e., Flex for ArcGIS). I think you can actually include a control in ESRI's api that provides a geocoding service, which you could use to get the coordinates from you database as well.
Is there a part of the api for access different map layer data such as population heat maps, county boundaries or zipcode lines?
I know this is mostly handled by people like ESRI/ArcServer but I was curious is there was some way to get similar information on the phone platform.
At this point, the only way i see it, is to have a huge data set, parse it, and draw the polygons myself. This sounds extremely time consuming on a phone.
Sadly Google, Bing Maps et al. don't expose access to their datasets in anything other than the pre-defined road, satellite styles etc. As tghamm suggests, your best bet for a performant solution on a mobile device is not to draw dynamic polygons, but pre-render your own raster tilesets for the area/zoom levels at which you want to display the data and display these as a custom tile layer ontop of the map control.
A good toolchain for creating such a tileset is:
1.) Use SQL Server Express (or PostGIS, if you prefer) as backend spatial DB - http://www.microsoft.com/express/sql/ ($0)
2.) Get necessary data in shapefile format - http://www.diva-gis.org/Data ($0)
3.) Load the shapefile data into SQL Server - http://www.sharpgis.net/page/shape2sql.aspx ($0)
4.) Write a query to retrieve the necessary information from SQL Server (or retrieve it directly from shapefile) and render it to tiles using Mapnik - http://www.mapnik.org ($0)
Total cost, $0.
Also, be sure to check out open street map - http://osm.org, which provide access to their entire database that you can download and render yourself - in many areas of the world (although not all) it beats both Google and Microsoft in quality and completeness of its data.
Often this data is delivered through use of a tile server, where the geometries are rendered on a server and then cut into tiles so that the client is only responsible for consuming the raster data. There's plenty of places to get good imagery:
http://www.census.gov/geo/www/tiger/
This is a good starting point for your basic geo-political shapes in the US.
From there, there are third party libraries capable of assisting you with consumption of those SHP files directly, such as http://www.thinkgeo.com/.
Alternatively, some people choose to upload the contents of the shp file into a db structure that supports spatial types. I've used Sql Server 2008, which is complimented by some .Net libraries to facilitate shape handling and manipulation for rendering.
Finally, there are likely a good number of open tile servers out there with useful data layers that you need only understand the tiling pattern to consume, e.g. WMS.
I want to write a GUI seating application that allows users to draw and annotate simple "maps" of seating areas.
The end result would probably look something a little like Visio, but specifically for manipulating my "seating" data model rather than producing files.
In Java-land, there's the Graphical Editing Framework (GEF) -- is there anything like this in the .NET space? Should I just use System.Drawing.Drawing2D primitives and handle it all myself?
Here is product from Nevron. It is paid but doing it all yourself will take lot of time and effort.
Open Diagram and EasyDiagram.net are available at Codeplex. Be sure to download and look into their code.
There is Netron Library for diagramming. It is open source and uses GDI+.
Check out NShape. It is an open source diagramming framework written in C# and quite powerful. Its controls are WinForms controls but you can also use it for WPF.
You might consider using the DSL Toolkit from the Visual Studio SDK. It allows you to create a graphical DSL designer by first creating a domain model, and then creating the graphical notation that will allow users to create or edit instances of that model.
You may very well be able to create a graphical notation that looks like a seating area. This would allow your users to not only "diagram", but to produce a file containing a filled-in domain model of what was diagrammed.
Check out our MetaDraw component - www.MetaDraw.com
MetaDraw is designed to make applications like this easy.
MetaDraw will support a background image and an annotation layer
You can put users into a variety of editing modes - Lines, Curves, Text, Shapes, etc.
Every drawn element is distinct - just like in Visio, so you can allow users to select objects and move them around or resize them. Every object can have multiple hidden tags ( like seat numbers or database record pointers ). You can recognize which objects users select ( for instance take some action when user clicks seat 22 ) . You can dynamically modify propertie by code - such as searching for seat 22 and changing it's fill color. Of course you can also scroll, zoom, print, save to a variety of formats and more.