Hot answers tagged java
15
I investigated exactly this question 20 years ago when designing a desktop GIS. We needed to find point-to-point distances interactively; our target was to do the computations in less than 1/2 second for thousands of points. Testing (on a 25 MHz 486 PC!) showed that we could compute all the distances, exactly as you describe (with the simple obvious ...
10
You dont need to program to do this - you just need a desktop mapping package and your data in a standard format.
Standard formats include shapefiles for points, lines, and polygons, and geoTIFFs for raster (gridded image-type) data.
I use the Open Source Quantum GIS, but there are other Open Source applications. Commercial GIS applications will be way too ...
8
Why not take a look at the open source projects out there.
Take a look at the source code, choose one or many of them and join the projects :-)
A few examples:
GVSig with both desktop GIS, mobile version and mini version for phones
http://www.gvsig.org/web/home/gvsig-home/view?set_language=en
JTS, Java Topology Suite (I think it means)
...
8
Widely used opensource GIS java libraries are GeoToolkit : http://www.geotoolkit.org/ and GeoTools (osgeo) : http://www.geotools.org/
An example of an application based on GeoToolkit : http://puzzle-gis.codehaus.org/
6
The answer to this is probably somewhat subjective depending on what environment or platform you are using. My approach is usually to look at the project and choose what works best for each situation. Generally, I lean towards .NET for ESRI based projects and Java for open source / other solutions. My experience has been that as long as you know how to ...
6
There is a very good web site for beginners about OpenStreetMap world focused on people coming from other mapping services that could fit your question: http://switch2osm.org/serving-tiles/
But if you want to create some tiles to be served offline something like http://www.maptiler.org/ but it's focused on raster data.
If I had to do this I would probably ...
5
I don't think this question is explicitly geographic, because you're only interested in names, so you may want to ask it on SO. You could answer your question with two pieces of information: the state and the corrected county name. To perform the corrections, you'd likely want to use the Levenshtein distance (example & java implementation) to match the ...
5
You can think of QueryInterface simply as a COM type-cast.
QI, or QueryInterface, is a term used by the Microsoft COM specification. The specification is a binary standard that is language agnostic (it can be implemented by various languages).
From Microsoft's documentation on COM:
The Microsoft Component Object Model (COM) is a platform-independent,
...
5
The GeoTools library supports WFS-T.
By using the class org.geotools.data.wfs.WFSDataStoreFactory you can connect to a WFS service. A transaction can be created using any class that implements the interface org.geotools.data.Transaction, for instance, the class org.geotools.data.DefaultTransaction.
GeoTools has also classes that will allow you to work ...
4
Have you considered writing a mobile web app using OpenLayers? It supports mobile phone browsers and WFS-T, and can play happily with GeoServer as a backend. The next version will support gestures and direct access to the phone's location services.
It does mean you'll have to use Javascript and HTML of course, but it would make your application easily ...
4
Maven can only handle libraries that are deployed on a maven repository, and Opencarto is not deployed anywhere, so you cannot get it with maven. To use it, you may use one of these methods:
you download an opencarto jar from there and include it in your eclipse project (you also need jts, xstream and xpp3_min)
you checkout the snapshot version of ...
4
If you do need to program an application in java you might want to consider GeoTools which is a Java toolkit for handling GIS data. UDig (on the OSGEO Dvd too) and GeoServer both use GeoTools. Depending on how you store your data GeoTools may have a datastore that will connect with it directly (shapefiles, databases etc) or it's not too hard to write your ...
4
What you want is called "warping" in GIS. It is mostly applied to images, rather than shapefiles, but the procedure for shapefiles is not hard. Let's take a look.
The white dots on the first image below represent an array of (lat, lon) grid points drawn in their correct locations on the image. The array does not appear perfectly regular due to ...
4
I have no experience with gvSig or Kosmo, however I programmed applications for uDig and reused components of Openjump.
From a software engineering perspective uDig proposes a neat platfor supported by Eclipse, an universal tool for serious developers. However, developing for uDig is cumbersome precisely because of the important role the Eclipse framework ...
4
Yes, it is possible to add PL/Java:
http://www.postgresql.org/docs/current/static/external-pl.html
Be sure to read up on the security issues involved in adding a new procedural language to PostgreSQL.
4
The units of measurement is based on the underlying spatial reference. So, for example, if it is EPSG:4326 it is decimal degrees or if it EPSG:2037 it is meters.
4
Is this what you're after?
http://weblogs.java.net/blog/cajo/archive/2010/10/16/adding-google-maps-your-java-application
You can also use Bing maps with Java, also worth looking at
GeoTools
NASA Worldwind
OpenMap
There's also a useful list of OpenSource Java GIS software here: http://java-source.net/open-source/geospatial
4
I've created a while ago a method to draw points on a layer from geotagged flickr pictures.
It shows basically how to create a FeatureLayer with custom points
public Layer getFlickrLayer(){
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName( "pictures" );
b.setCRS( DefaultGeographicCRS.WGS84 );
//picture location
...
3
You might want to use GeoExt. It combines OpenLayer's web mapping capabilities with ExtJS' widgets. Their page has great examples. It's also used by the OpenGeo Suite's GeoExplorer, GeoEditor and Styler apps.
Here's a sample site using a customized GeoExplorer:
http://www.opengeohost.com/slcgeoexplorer/
3
A great option is going to be OpenLayers; this will help you show your data in a view, from there I would go to either Dojo or Ext as a UI builder.
Dojo has some great widgets to build a quick and thin UI that using CDN means you get fast and distributed downloads of the scripts to the user.
3
The KML support is tied into the XML facilities for encoding and parsing geometry.
The GeoTools user guide has replaced the wiki links provided by Ian above - with a nice clear page devoted to wrangling geometry and XML:
http://docs.geotools.org/latest/userguide/library/xml/geometry.html
One of the headings on that page is devoted to KML ...
3
There is a KMLExample at http://svn.osgeo.org/geotools/trunk/demo/example/src/main/java/org/geotools/demo/xml/KMLExample.java which shows the KML bindings in use for writing. From other discussions on the user list it seems that the KML bindings work in a similar way to the GML bindings so look at http://docs.codehaus.org/display/GEOTDOC/GML+XML+Support for ...
3
Here is some information from ESRI on how to develop GIS applications with Java:
http://www.esri.com/getting-started/developers/java.html
For Java EE developers, Esri offers
the Web ADF for the Java platform, a
Java web framework that extends the
JavaServer Faces (JSF)
specification.
...
3
A good resource for just getting point features is GeoNames, which lists even some fairly obscure train stations, although I'm not sure about bus stops. You can download the data as a CSV which makes importing into PostgreSQL easy, and you won't have to download vast amounts of OSM data only to reject most of it. Of course, if you do need road data, then OSM ...
3
You can use the com.vividsolutions.jts.io.oracle.ORAWriter constructor. It "translates a JTS Geometry into an Oracle STRUCT representing an MDSYS.GEOMETRY object.". But for this you need an OracleConnection. It's required by that constructor. Using this kind of implementation you don't have to worry how the several attributes from the SDO_GEOMETRY object are ...
3
If you're referring to NASA's SRTM dataset, there is an alternative to GeoTIFF file format - you can download HGT files, which are simpler to decode (see the Quickstart PDF and the rest of the SRTM documentation).
You can also check out my answer to a similar question: How to get an elevation profile for a gps track?
3
QI in simple words means to acess the same object via a different interface.
Suppose you have an ObjectClass object. In the COM world, you generally don't access it directly, but only Via interfaces. Hence you can access it from ITable, IClassSchemaEdit and many other interfaces.
When you call IFeatureWorkspace.OpenTable, It returns an ITable, and hence ...
3
Here's the short answer to some of your questions:
Java is a programming language similar to C# in both syntax and execution. It compiles to something called bytecode which can then be run on multiple platforms (Unix, Windows, etc.) via a "virtual machine."
Javascript is not at all related to Java. There is no bytecode run on a "virtual machine"; the code ...
3
You'll need to add a WMS layer for your background map. The GeoTools tutorial has sections on adding WMS layers and querying databases (Example uses a PostGIS database). You might want to check them out.
Only top voted, non community-wiki answers of a minimum length are eligible

