Ron McLeod wrote:If you compress your resource in the application and then pass it the server something with a Content-Type of application/gzip, the server will no longer be able to tell the format of the representation (json, xml, csv, etc.). The compression and expansion of the payload should be managed by the HTTP client and server and it should be transparent to the application at either end. Here's an example of what the HTTP headers will look like leaving the HTTP client without and with gzip encoding:
Without gzip compression enabled in the client:
With gzip compression enabled in the client:
Tim Holloway wrote:This isn't really a Tomcat question, but I'll try.
AWS, like some other cloud platforms, is based on the concept of overlaying local mods on a master image. You can then make a snapshot image containing these mods.
Yes, you can resize the virtual disk that you're running on (although you should consider using an alternative daa-only virtual disk), but that doesn't resize the original image. Basically, what effectively happens when a new instance is created is that a new, blank virtual disk is created, the OS image is copied onto it and booted, and any unused space in the virtual disk is just ordinary free space. If you stop the instance, the virtual disk remains. If you terminate the instance, the virtual disk (and its contents) are deleted. Eventually. AWS cleans up when it's convenient, so it doesn't immediately delete terminated instances.
chris webster wrote:There are 3 elements to this functionality:
1. Spatial data.
2. Spatially aware database
3. Spatially aware query functions.
1. Spatial data
From what you say, it sounds like you want to be able to query with a long/lat point and find out which country contains that point e.g. (51N,1W) would be in the UK. You will need a set of data which holds the long/lat polygon (shape) coordinates for each country you're interested in e.g. if you lived in an imaginary square country, then the polygon would just have 4 pairs of coordinates. Unfortunately, real countries have much more complex shapes (and islands) which means their boundary polygons contain a lot more coordinates. The most widely used spatial data file format is probably ESRI's shapefile format, which most GIS (geographical information systems) products can read. You should be able to find one of these online e.g. here is a free shapefile with country boundaries and some other data. Once you have a suitable file, you will need a suitable place to put it so you can query it properly.
2. Spatially aware database
There are several free open source databases that can handle spatial data.
PostgreSQL is a mature and widely used relational (SQL) database that can be used for all kinds of applications, including GIS. If you decide to work with PostgreSQL, you will also need to install the PostGIS extensions (some PostgreSQL distributions may include this or you can install it yourself). PostGIS provides a lot of clever SQL extension functions that allow you to perform very rich queries on spatial data, combining spatial queries with regular SQL queries, as well as powerful indexing tools to make querying spatial data more efficient, and a range of functions to do things like converting between coordinate systems e.g. long/lat <--> Universal Transverse Mercator etc. PostgreSQL/PostGIS are widely used for GIS, and they are well documented online and in books, with lots of tutorials and examples.
MongoDB is another open source DB that can do some spatial queries, but the spatial functionality here is much less sophisticated than in PostgreSQL/PostGIS, and of course it is a NoSQL database so it may not be as easy to integrate with other parts of your application.
3. Spatially aware query functions
Your query needs to be able to handles questions like "what country contains the point (51N, 1W)?". In order to do this, the query tool needs to know how to interpret spatial data and also how to do so efficiently via spatial indexes. PostgreSQL/PostGIS and MongoDB can both do this, but they do so with very different query syntax. Unless you have a particular need to use MongoDB, I would recommend you try PostgreSQL/PostGIS because the spatial queries are easier to design, easier to implement and easier to integrate with other non-spatial queries. And of course there are lots of examples of how to do this with PostGIS e.g. this tutorialmight help you get started.
If you decide to use MongoDB, there are some basic tutorials on their website as well.
Hope this helps.
mydukuri sreenu wrote:
david dabush wrote:Hi,
i am using @RequestParam(value = "ip",required = false) String ip to get ip from url.
but my partners can use many formats like : ip,dip ipaddress.
how can I use multiple mapping?
you can pass map as parameter in the place of string , then you can get the value based on the key syntax as fallows
@RequestParam(value = "multipleIps",required = false) Map multipleIps