How can i render a very big SVG file in HTML5? - html

I have recently wanted to create something similar to this on my own: http://www.unitedstateszipcodes.org/
It is basically a map of zipcodes for the United States. Currently, i have thousands of points that compose the Zip Code boundaries. With these coordinates, I created a KML file. However, it seems that the file is way too big (32MB) When i render it on the browser, it takes a long time to load and it looks very bury.
What approach should i take to make it faster?
What i want to do is to be able to see a map of all the zipcode areas in the United States. I should use SVG or Canvas. I chose to use SVG: http://danilocarrion.com/Map.html
Please let me know if there is a way to make it faster, sharper. Thanks

You might want to look into topojson, a tutorial and some instructions can be found here.

Related

Doing an Image Search?

Is it possible to perform an image search with google maps? For example, if I had a small section of a map, showing road configurations, but there were no labels to indicate street names or place names, is there a possible way to do an image search, similar to what you can do with regular google, to be able to identify that location? I have tried this with the regular google, and it does not work. Does anyone know of software or an app that has the ability to do this? Thanks!
Yes it may be possible , But I do not think any software or app that is currently available a program would be need to be written that takes that small section of a map that you have and it would have to be a rather good quality image and preferaby in a raw Bitmap format and then the small section of the map you provide would have to be overlaid over the main google map and then moved around the map... scanned and each pixel compared frame by frame as the search picture is scanned across the bigger map and then a best-fit process would be utilized , and then when it finds a match it can then let you know just how closely it matches and what the confidence level it is that that the location found is actually correct , it would be best to narrow it down as much as possible as well, also a bit of artificial intelligence might be very useful here too, a face recognition A.I. program could be modified to complete that task. but as far as I know none of that exists in a single readily available app or program , maybe someday someone would create such a program? it is possible.

Polygonal Search

I have read several of the posts concerning Polygonal Search, but they are all about fixing or updating the programs. I am just wondering how it works. If there is a way I can get something like pseudo code of it or an explanation of how a shape captures the data points.
To further specify my goal, I am trying to make a constant square that will be held over a map (such as google maps), but the map can move around behind the square, however, the square will continue to report whatever cities lie within its bounds. [I will eventually proceed to building it, I just need some guidance]
Thank you.
There is an open-source library which has a function to check if two shapes overlap. You can check source code:
http://turfjs.org/static/docs/module-turf_inside.html
If you look for theory behind it check Hyperplane separation theorem

Plotting tools for dashboard

After browsing for a while for available solutions, it is really hard to choose the most appropriate tool for creating dashboard & populating it with plots. I would want to have an html page with multiple plots and tables depicted. I'm thinking to have data input stored in csv files, appropriately formatted.
The requirements are:
plot coordinates are showing on mouse hover
ability to show coordinates of points on a plotted line (points in
scatter plot or bar values for bar chart) 'sticking' to the nearest
lines on hover, with appropriate handling of multiple lines (show several y values for same x)
ability to interactively switch plotted data on/off
easily embeddable into html page, doesn't require additional plugins installed
a good variety of plot types
not too slow to load and stable, there could be ~50 plots on one page
(this is for internal use only, so quickness is not that important)
does it all with minimal effort
So far I checked out (by no means a final opinion, correct me if I'm wrong):
gnuplot+canvas - looks good, but samples on their page fail to work
well for me, not always getting mouse clicks right
python+matplotlib+mplh5canvas - feels a bit raw, as I understand
some of the stuff above I'd need to implement in Python myself
RGraph looks awesome at first glance, not sure if it is good since never heard of
it and don't have any experience in js, hard to customize(?)
some other random stuff which seemed bad enough
Suggestions?
RGraph looks awesome, and is awesome. It's not difficult to use and there are a lot of examples online.
Rgraph Example page
They've got 22types of graphs, correct me if I'm wrong, and as I already said, easy to use.
Documentation about possibilities and stuff for each type of graph is also available on the website.
I end up using Highcharts because of its very advance features and ready-to-use templates (in addition to the things mentioned in the question).

HTML Image Maps - Is there an easy way to create and modify them?

Starting out with a given image, I would like to be able to trace polygons on the image and then export the result as an HTML image map.
What would also be nice is to be able change the scale of an existing image map, thereby changing the size of the polygons and shapes.
Is there a program that anyone knows of that has these features?
Many program do this. It is to time consuming doing complicated maps manually.
I know coffeecup is a used tool for this.
What would also be nice is to be able change the scale of an existing image map ..
I wrote a Javascript image map resizer, it's here. Just paste in your HTML and it will return the scaled image map. You must include "height" and "width" attributes for the original image in the HTML. (This is a quick and dirty tool, it doesn't actually do anything other than parse the HTML you've pasted in. It uses those attributes as the base of calculations).
You may also be interested in my jQuery plugin ImageMapster which can resize image maps dynamically among other things.
I use this site it's fairly good for quickly making image-maps
I use this site https://www.image-map.net/ to trace polygons on the image and then export the result as an HTML image map.

Drawing resizable (not intersecting) polygons

I have been searching everywhere but I could not find an answer. I
need to have drawing resizable polygons with mouse interaction but I
do not want irregular, overlapping or intersecting polygons in the
end.
Here is a simple example of drawing resizable polygons
http://www.wolfpil.de/polygon.html
You can easily create & resize polygons which is great. But I need an
extra functionality to detect intersections and NOT allowing weird
looking shapes/polygons.
You can see the problem in this video:
http://www.youtube.com/watch?v=zou2jcGM8zw
The only solution for that problem I found at http://www.wikimapia.org. They have added features to handle the problem.
You can see it in this video: http://www.youtube.com/watch?v=K7-K0k2D-2A
I spent 3 days trying out to achieve something like this. I have gone
through wikimapia's javascript code but it is way too complex for me
to understand.
In sum, it does not have to look as fancy as as wikimapia's. I just
need resizable polygons which do NOT intersect while resizing or
adding new points to it. Can you give me any suggestions how to
achieve that?
Thank in advance.
Depending on how many points that you allow, a naive, simple O(N^2) line intersection algorithm suffices. Algorithmically this is not the best solution, but for starting out it's the most accessible for a beginner in computational geometry.
For starter, see Wikipedia article on line segment intersection. One of its links has an easy to understand explanation on how to compute the intersection point of two line segments.
Good luck!
While this is not a complete answer, note that the example you supplied appears to be using the Geometry Controls from the GMaps Utility Library, which is an open source project hosted on Google Code.
You can check the full source code in the Google Code browser.