Local application with maps - java

I'm currently building a web application using Google Maps. Unfortunately, I've reached the absolute maximum limit that Javascript will reach for all of the different things I'd like to do, and we're exploring all of the alternatives.
We've looked at server-side caching and pre-generation/computing. It's definitely a possibility, but supposedly even that is 'too slow' while trying to plot 100k+ points in one go. As everything (as always) needs to always load instantly (or as near as darnit), I'm looking at a local application as an alternative.
Before I put forward the idea (which I already know that everyone will go for), there are two things I'm looking at first:
Can I use Google Maps locally?
I want to take the application between just PC and Mac. I'm a WPF and Web developer. Windows side, fine. Mac, however, doesn't play so nicely with those technologies. Is it time for me to bite the bullet and learn Java?
Thanks for your help!

No idea if this meets their TOS, but you could look into: http://www.howtogeek.com/90565/how-to-download-google-maps-for-offline-use/
Java AFAIK is the most main-stream high level cross-platform language for desktop applications.
Mono install rate on macs is probably extremely low in comparison to Java, though that might not be a problem if you use mkbundle. and WPF isn't supported (though GTK# is). You could do Silverlight/Moonlight, which are supported outside the browser, and quite similar to WPF.
You could also look at using C++ or Python with wxWidgets. Though if you go with Python, there are a ton of GUI libraries for it.

As I understand it, your map application involves plotting 100,000+ markers (latitude/longitude points) on a single map. You presently draw the markers on the map using JavaScript code and function calls.
Consider sticking with web-hosted Google Maps, and using one of two alternate implementation approaches.
Aggregate points. You can try drawing 100 markers onto the same screen pixel, but the user won't get any more information than if you just drew one marker. Consider aggregating multiple closely-spaced markers into aggregate markers. Google's docs have suggestions about how to do this in "Too Many Markers!", by Luke Mahe and Chris Broadfoot, Google Geo APIs Team, December 2010 (http://code.google.com/apis/maps/articles/toomanymarkers.html).
Draw markers yourself onto custom map tiles. I'm involved with a maps application which uses the Webfoot Map Tile Generator code, which takes this approach to draw approx 50,000 dots on a map of the continental US marking the location of each US Zip Code. See (http://maps.webfoot.com/demos/election2008/), and in the left pane, under "Dots Layer", select "Zip Codes" in the pull-down menu. Drawing your own map tiles isn't easy, but it's very powerful, and the Webfoot code shows it can be fast. Google doesn't completely document how to do this. But start with their description of implementing "your own custom map type using GMapType" (code.google.com/apis/maps/documentation/javascript/v2/overlays.html#CustomMapTiles) in the Maps Javascript API v2. The equivalent for the Javascript API v3 appears to be missing from (code.google.com/apis/maps/documentation/javascript/overlays.html#CustomMapTypes).

Related

Is there a 3D version of GraphViz?

I find GraphViz easy to use, but it renders 2D graphs. Is there an equivalent that renders 3D graphs? The nodes could stay 2D but the graph as 3D would be great. If not, is there an alternative such as using a Perl module or Java package?
My searches only result in 3D gaming engines.
With GraphViz, you can render directly to VRML:
dot -Tvrml graphviz.dot > graphviz.vrml
Then you can use this tool (a java jar that can be run from the command line) to convert VRML to X3D:
http://www.deem7.com/vrmlmerge/howto.php
And then view the X3D file in a browser using the following techniques:
http://doc.x3dom.org/tutorials/models/inline/index.html
Update (years later): deem7.com seems to have gone away, although you can find the original tool via the wayback machine, there are other online tools that seem to do this. Example: https://doc.instantreality.org/tools/x3d_encoding_converter/
There is not a great interactive tool I know about, but you can generate a 3D layout in Pajek and then use the King viewer in a website. You can see an example in this YouTube video, with a screenshot here:
Just so you know, while 3D graph visualizations look pretty they are actually quite poor at showing graph structure due to lots of occlusion. This is even worse for a static image with no interaction. I would highly suggest using a good 2D graph visualization system like Gephi, NodeXL, or Cytoscape. Disclaimer: I am an advisor for the NodeXL project.

Recommendations / advice needed for application technology set

I have an idea for a GUI application, however it needs a set of technologies that i do not use frequently (as such i am a bit of a novice here, apologies if this is stupid!).
I want a 3D Earth Model, (like google earth, the actual look to be like the terrain overlay in google maps (I don't care about roads, just height & position)). Like google maps & google earth i will wish to add my custom tracks & locations & boundaries; and move / pan / tilt etc...
I cannot however be continually connected to the internet. So i will need a 1 time download of terrain/geodata before i startup the program. (Can this be done as a single kml dataset ? (Is that even correct?) i guess i would need a 'local map server' instead of an internet connection?)
I will need to use a precompiled language (preferably java) to actually write the program in. (Scripting / Javascript is not acceptable) Can i interface Java & KML using an existing library ?
Is it possible to reproduce the google maps 'map window' with the terrain imaging in 3rd party software ? (Can i pull this from open source somewhere?)
Everything you want to do is possible -- however -- let me preface this by saying that it will be a long, difficult journey.
Let's start with the easy thing: you can load your data as KML, it will show up as a layer in Google Earth, and you'll be able to turn it on and off. You'll also be able to turn off default layers (roads, etc) either programmatically or via the GUI.
I would use Google Earth (the web plugin thing) tied to a C# application. You do not want to use the old Google Earth COM API. It was deprecated by Google as of GE 6, and was truly a terrible thing to work with. Java could also work, but I prefer C# development. In either case, you can use the language's ability to call into the Google Earth API directly.
Here's a good example (C#). It's GNU/GPL, so it may work as a base for your app:
http://code.google.com/p/winforms-geplugin-control-library/
Essentially, you load a Google Earth web page in a WebBrowser control, which allows you to manage it directly. Actually interfacing with the web page is the hard part (but still easier than the COM API!) -- hopefully you can use the control library linked above to get a feel for how it works.
As for your internet connectivity issue: yes -- Google Earth (even the web plugin) supports caching. The exact amount of cache that is allowed is ~100 MB. Exactly what goes in the cache is a complete mystery. The 100MB limit won't get you very far -- but you can create larger caches (up to 2GB) using the full Google Earth app. These caches work with the web browser plugin, you just have to copy the database file into the Google Earth application data directory (and rename the file I think -- the plugin appends a 0 or something to the file name.) The process for creating a cache is simple -- fly around the area in question at the altitude you'd like. There are tools to help automate this, such as:
http://bx11.110mb.com/gecacher.htm
Note that caching Google's data isn't exactly what they'd like you to do. So please keep in mind that you'll need to fully review the EULA to make sure you're not violating it...
Good luck! I've been working with GE in a large app for ~3 years; It's definitely a fun thing to work with and can make your application really stand out.

Searching for Java library to build an app that interacts with data

I have a project where I should analyse data via cluster analysis. Basically the data should be visualised like this picture shows
Each dataset - for example let it be people - is one horizontal row, where vertical lines showing the attributes like sex, age, and so on.
Now if this data could be shown I also want to move the rows horizontal and also vertical a) via code and b) via drag & drop.
Do anybody know a good library for that?
Important
Target is desktop application
Expected datasets around 500
Attributes for each data set around 60
There is an app in Java/SWT already, so solutions in this direction would be preferred
The OS is Win7 so C# or similar would be a stopgap
I really like d3.js, and would prefer a similar lock & feel (but in 3D)
If somebody has recommendations for a library which helps to analyze the data, please step forward too!
Check What is the best open-source java charting library? and Libraries for pretty charts in SWT? for more info.
I did used JFreeChart with SWT (2 years ago). The code is quite horrible (you have to write tons of code), but it works and is directly renderable with SWT components (no need of SWT_AWT bridge).
EDIT
When I thought about it again, I realized, that you can use the JavaScript library through Browser widget. It's quite heavyweight solution, but it might work..
You can do this in d3 but it is a very involved process in which you need to deal with the ismoetric perspective and the rest. It shouldn't be terribly complicated but it will not be an out-of-the-box solution.

Flex 2D graphics learning path for Java/GWT developer?

I have been developing with Java for several years and last six months I have been building GWT based application. But I have almost no Flash or Action Script experience and I would like to try out some hobby programming with Flex. Especially 2D graphics and image manipulation would be interesting topics.
Adobe's tutorials for Java developers are naturally the starting point but I would need some pointers for graphics. Something like drawing 2D graphics based on data from the server or modifying image uploaded by user. How much can be done on the Flex and what must be done on the server side?
For drawing you don't need the 'full' flex library, flex will mostly provide you with a nice set of GUI components and some ways to integrate with your back-end server easily.
If you just want to draw something check out the Graphics object http://livedocs.adobe.com/flex/3/langref/flash/display/Graphics.html - it works similar to the java Graphics object.
If you want to modify an image uploaded by the user you are of course already at the server (because the image was uploaded) - however the new flash player (version 10) allows some manipulations of local data as well, so it might even be possible to show a modified image that was not even uploaded, see http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/ for example.
Flex/AS3 will feel a bit weird to a java programmer - parts of it are very easy and other parts will be frustrating, tooling support is worse, slow compiler, no support for running unittests without jumping through lots of hoops (don't get me started...). But as a deployment platform I must say I like it a lot.

Java VNC Applet vs Screen Capture

I am trying to make an application in which one component captures the screen of the user (for screen casting). I am aware that there are two options to achieve the same using a Java applet (please correct me if I am wrong). First is to use the java applet to take screen shots continuously and convert it into a video and upload it as a video file. And second is to create a java vnc server and record it as a .fbs file and play it using a player like: http://www.wizhelp.com/flashlight-vnc/index.html
I would like to know the best solution in terms of video quality, file size, cross-platform compatibility (windows and mac), firewall problems and finally ease of implementation.
I am very new to Java. Please tell me whats the best solution for my problem. Also, is it easy enough for me to program it on my own or should I get it developed via a freelancer. I have tons of programming experience (5+ years in LAMP) but none in Java.
Thank you very much.
I agree that this is pretty hard. I implemented those two solutions (VNC and onboard screen capture) plus a third (capture from an external VGA source via an Epiphan grabber) for a former employer. I had the best bandwidth-to-quality ratio with VNC, but I got higher framerate with VGA capture. In all three cases, I reduced the frames + capture times to PNGs and sequenced them in a QuickTime reference movie. Then I made flattened video (MPEG4 or SWF) of the results. In my case, I then synchronized the screen video with a DV stream.
In the end the technology worked (see a sample of the output) but our business model failed.
From what I know, the older versions of applet had security restrictions that may not allow for screen capture. Instead, a java application may be feasible.
Regarding the build-it-yourself vs the fire-a-coder, it depends on how you value your time compared to what you can find on a freelancer site.
I think you can find someone from India/Romania/Poland/Other countries that can make it for an affordable price
Given your Java knowledge and the difficulty of the task, have you considered taking an alternative approach? For example, how about a native VNC server for the end-user, which is just a small download and then they click "Run." And that native server is programmed to capture the screen and send it straight to your web server, which has a client like vnc2swf or other means of converting the VNC stream to a video or .fbs file? Does all that make sense?
Admittedly, without Java, you have to prepare one executable program per platform you want to support, however, I don't know. That still sounds easier to me. Consider Copilot.com. They are doing VNC but they still use small native apps for each platform.
Sorry but this seems the kind of job that requires a lot of experience. Even if you find code snippets all around the net to fix this and that, the overall result may be way worse than simply hiring an experienced Java programmer.

Categories