Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Geo Tools
Commits
6f606a04
Commit
6f606a04
authored
May 30, 2016
by
Matija Obreza
Browse files
Removed Swing GUI thing
parent
36b9d3d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
6f606a04
...
...
@@ -69,11 +69,11 @@
<artifactId>
guava
</artifactId>
<version>
19.0
</version>
</dependency>
<dependency>
<!--
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>${geotools.version}</version>
</dependency>
</dependency>
-->
<dependency>
<groupId>
com.opencsv
</groupId>
<artifactId>
opencsv
</artifactId>
...
...
src/main/java/org/genesys/geotools/gui/Quickstart.java
deleted
100644 → 0
View file @
36b9d3d2
/*
* Copyright 2016 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.genesys.geotools.gui
;
import
java.io.File
;
import
org.geotools.data.FileDataStore
;
import
org.geotools.data.FileDataStoreFinder
;
import
org.geotools.data.simple.SimpleFeatureSource
;
import
org.geotools.map.FeatureLayer
;
import
org.geotools.map.Layer
;
import
org.geotools.map.MapContent
;
import
org.geotools.styling.SLD
;
import
org.geotools.styling.Style
;
import
org.geotools.swing.JMapFrame
;
import
org.geotools.swing.data.JFileDataStoreChooser
;
/**
* Prompts the user for a shapefile and displays the contents on the screen in a
* map frame.
* <p>
* This is the GeoTools Quickstart application used in documentationa and
* tutorials. *
*/
public
class
Quickstart
{
/**
* GeoTools Quickstart demo application. Prompts the user for a shapefile
* and displays its contents on the screen in a map frame
*/
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// display a data store file chooser dialog for shapefiles
File
file
=
JFileDataStoreChooser
.
showOpenFile
(
"shp"
,
null
);
if
(
file
==
null
)
{
return
;
}
FileDataStore
store
=
FileDataStoreFinder
.
getDataStore
(
file
);
SimpleFeatureSource
featureSource
=
store
.
getFeatureSource
();
// Create a map content and add our shapefile to it
MapContent
map
=
new
MapContent
();
map
.
setTitle
(
"Quickstart"
);
Style
style
=
SLD
.
createSimpleStyle
(
featureSource
.
getSchema
());
Layer
layer
=
new
FeatureLayer
(
featureSource
,
style
);
map
.
addLayer
(
layer
);
// Now display the map
JMapFrame
.
showMap
(
map
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment