Revision 6137

View differences:

org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
    <modelVersion>4.0.0</modelVersion>
4
    <artifactId>org.gvsig.lidar</artifactId>
5
    <packaging>pom</packaging>
6
    <version>1.0.125</version>
7
    <name>org.gvsig.lidar</name>
8
    <description>LDAR-support library extension</description>
9
    <parent>
10
        <groupId>org.gvsig</groupId>
11
        <artifactId>org.gvsig.desktop</artifactId>
12
        <version>2.0.367</version>
13
    </parent>
14

  
15
    <url>http://devel.gvsig.org/sites/org.gvsig.lidar/${project.version}</url>
16
    <scm>
17
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125</connection>
18
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125</developerConnection>
19
        <url>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125</url>
20
     </scm>
21
    <developers>
22
        <developer>
23
            <id>cmartinez</id>
24
            <name>Cesar Martinez Izquierdo</name>
25
            <email>cmartinez@scolab.es</email>
26
            <roles>
27
                <role>Architect</role>
28
                <role>Developer</role>
29
            </roles>
30
        </developer>
31
    </developers>
32
    <distributionManagement>
33
        <site>
34
            <id>gvsig-repository</id>
35
            <url>dav:https://devel.gvsig.org/sites/org.gvsig.lidar/${project.version}</url>
36
        </site>
37
    </distributionManagement>
38
    <repositories>
39
        <repository>
40
            <id>gvsig-public-http-repository</id>
41
            <name>gvSIG maven public HTTP repository</name>
42
            <url>http://devel.gvsig.org/m2repo/j2se</url>
43
            <releases>
44
                <enabled>true</enabled>
45
                <updatePolicy>daily</updatePolicy>
46
                <checksumPolicy>warn</checksumPolicy>
47
            </releases>
48
            <snapshots>
49
                <enabled>true</enabled>
50
                <updatePolicy>daily</updatePolicy>
51
                <checksumPolicy>warn</checksumPolicy>
52
            </snapshots>
53
        </repository>
54
        <repository>
55
            <id>osgeo</id>
56
            <name>Open Source Geospatial Foundation</name>
57
            <url>http://download.osgeo.org/webdav/geotools</url>
58
            <releases>
59
                <enabled>true</enabled>
60
                <updatePolicy>never</updatePolicy>
61
                <checksumPolicy>warn</checksumPolicy>
62
            </releases>
63
            <snapshots>
64
                <enabled>false</enabled>
65
            </snapshots>
66
        </repository>
67

  
68
    </repositories>
69

  
70
    <properties>
71
        <svn.tags.folder>https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.lidar/tags/</svn.tags.folder>
72
    </properties>
73

  
74
    <dependencyManagement>
75
        <dependencies>
76
            <dependency>
77
            	<groupId>org.gvsig</groupId>
78
            	<artifactId>org.gvsig.gdal.app.lidar.mainplugin</artifactId>
79
                <version>1.0.1-SNAPSHOT</version>
80
            </dependency>
81
            <dependency>
82
            	<groupId>org.gvsig</groupId>
83
            	<artifactId>org.gvsig.lidar.prov.common</artifactId>
84
                <version>1.0.125</version>
85
            </dependency>
86
            <dependency>
87
            	<groupId>org.gvsig</groupId>
88
            	<artifactId>org.gvsig.lidar.prov.jgrass</artifactId>
89
                <version>1.0.125</version>
90
            </dependency>
91
            <dependency>
92
            	<groupId>org.gvsig</groupId>
93
            	<artifactId>org.gvsig.lidar.prov.whitebox</artifactId>
94
                <version>1.0.125</version>
95
            </dependency>
96
            <dependency>
97
                <groupId>whitebox</groupId>
98
                <artifactId>whitebox-api</artifactId>
99
                <version>3.3.0</version>
100
            </dependency>
101

  
102
            <dependency>
103
                <groupId>org.jgrasstools</groupId>
104
                <artifactId>jgt-jgrassgears</artifactId>
105
                <version>0.8.0</version>
106
            </dependency>
107
            <dependency>
108
                <groupId>net.java.dev.jna</groupId>
109
                <artifactId>jna</artifactId>
110
                <version>4.2.2</version>
111
            </dependency>
112
            <dependency>
113
                <!--
114
                GeoAPI dependence is necessary for JGrasstools LAS readers, but
115
                newer or older versions of the API (e.g. 3.0) are also valid,
116
                as it is only used as a fake object
117
                -->
118
                <groupId>org.opengis</groupId>
119
                <artifactId>geoapi</artifactId>
120
                <version>2.0</version>
121
            </dependency>
122

  
123
        </dependencies>
124
    </dependencyManagement>
125

  
126
   <build>
127
        <pluginManagement>
128
            <plugins>
129
                <plugin>
130
                    <groupId>org.apache.maven.plugins</groupId>
131
                    <artifactId>maven-release-plugin</artifactId>
132
                    <configuration>
133
                        <tagBase>https://devel.gvsig.org/svn/gvsig-lidar/tags</tagBase>
134
                    </configuration>
135
                </plugin>
136
                <plugin>
137
                    <groupId>org.apache.maven.plugins</groupId>
138
                    <artifactId>maven-compiler-plugin</artifactId>
139
                    <version>2.3.2</version>
140
                    <executions>
141
                        <execution>
142
                            <id>default-compile</id>
143
                            <configuration combine.self="override">
144
                               <compilerArguments>
145
                                   <source>1.7</source>
146
                                   <target>1.7</target>
147
                               </compilerArguments>
148
                            </configuration>
149
                        </execution>
150
                        <execution>
151
                            <id>default-testCompile</id>
152
                            <configuration combine.self="override">
153
                                <compilerArguments>
154
                                    <source>1.7</source>
155
                                    <target>1.7</target>
156
                                </compilerArguments>
157
                            </configuration>
158
                        </execution>
159
                    </executions>
160
            <configuration combine.self="override">
161
              <source>1.7</source>
162
              <target>1.7</target>
163
              <encoding>ISO-8859-1</encoding>
164
            </configuration>
165

  
166

  
167
                </plugin>
168
                <plugin>
169
                    <groupId>org.codehaus.mojo</groupId>
170
                    <artifactId>animal-sniffer-maven-plugin</artifactId>
171
                    <version>1.9</version>
172
                    <executions>
173
                        <execution>
174
                            <id>check-java-api</id>
175
                            <phase>package</phase>
176
                            <goals>
177
                                <goal>check</goal>
178
                            </goals>
179
                            <configuration combine.self="override">
180
                                <skip>true</skip>
181
                                <signature>
182
                                    <groupId>org.codehaus.mojo.signature</groupId>
183
                                    <artifactId>java18</artifactId>
184
                                    <version>1.0</version>
185
                                </signature>
186
                                <ignores>
187
                                    <ignore>net.sourceforge.cobertura.coveragedata.TouchCollector</ignore>
188
                                </ignores>
189
                            </configuration>
190
                        </execution>
191
                    </executions>
192
                </plugin>
193
            </plugins>
194
        </pluginManagement>
195
        <plugins>
196
                <plugin>
197
                    <groupId>org.codehaus.mojo</groupId>
198
                    <artifactId>animal-sniffer-maven-plugin</artifactId>
199
                    <version>1.9</version>
200
                    <executions>
201
                        <execution>
202
                            <id>check-java-api</id>
203
                            <phase>package</phase>
204
                            <goals>
205
                                <goal>check</goal>
206
                            </goals>
207
                            <configuration combine.self="override">
208
                                <skip>true</skip>
209
                                <signature>
210
                                    <groupId>org.codehaus.mojo.signature</groupId>
211
                                    <artifactId>java18</artifactId>
212
                                    <version>1.0</version>
213
                                </signature>
214
                                <ignores>
215
                                    <ignore>net.sourceforge.cobertura.coveragedata.TouchCollector</ignore>
216
                                </ignores>
217
                            </configuration>
218
                        </execution>
219
                    </executions>
220
                </plugin>
221
        </plugins>
222

  
223
    </build>
224
    <modules>
225
        <module>org.gvsig.lidar.app</module>
226
        <module>org.gvsig.lidar.prov</module>
227
    </modules>
228
</project>
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	
4
    <modelVersion>4.0.0</modelVersion>
5
    <artifactId>org.gvsig.lidar.app</artifactId>
6
    <packaging>pom</packaging>
7
    <name>org.gvsig.lidar.app</name>
8
    <parent>
9
        <groupId>org.gvsig</groupId>
10
        <artifactId>org.gvsig.lidar</artifactId>
11
        <version>1.0.125</version>
12
    </parent>
13

  
14
    <modules>
15
      <module>org.gvsig.lidar.app.mainplugin</module>
16
      <!--
17
      <module>org.gvsig.lidar.app.export</module>
18
      -->
19
    </modules>
20
</project>
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/buildNumber.properties
1
#Tue Jul 10 00:21:13 CEST 2018
2
buildNumber=31
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/resources-plugin/README_en.txt
1
org.gvsig.lidar
2
===============
3

  
4
org.gvsig.lidar is a provider to read and write LAS files on gvSIG, as
5
defined by LAS specification:
6
https://www.asprs.org/committee-general/laser-las-file-format-exchange-activities.html
7

  
8
The plugin is designed to work on gvSIG 2.2 and 2.3. It requires gvSIG to be
9
executed with a Java JVM version 8.0 or higher, as the libraries it uses
10
require Java 8.0.
11

  
12
LAS files are dessigned to store clouds of 3D points captured using LIDAR
13
sensors. They have a set of mandatory fields and set of optional ones,
14
depending on the point data format specified on the LAS header.
15

  
16
The following mandatory fields are exposed as layer fields by the DAL
17
providers:
18
- CLASSIFICATION
19
- POINTX (x coordinate of the point)
20
- POINTY (y coordinate of the point)
21
- POINTZ (z coordinate of the point, useful to symbolize terrain elevation)
22
- INTENSITY
23
- RETURNNUM (return number)
24
- NUMBEROFRETURNS (number of returns)
25

  
26
The following optional fields are exposed as layer fields by the DAL
27
providers when available on the LAS file:
28
- COLOR (point color expressed as an RGB Java long)
29
- TIME (absolute capture time as a long integer, as generated by Data.getTime())
30
- WEEKTIME (relative capture time, expressed as GPS week time)
31

  
32
org.gvsig.lidar provides 2 different LAS drivers, based on 2 different
33
libraries:
34
- The JGrasstools-based provider is a read/write driver. It will use
35
  the C-based libLas library if available on the native library path,
36
  and it will use a pure Java implementation if libLAS is not available
37
  or not successfully loaded. Note that only the Java version has been
38
  tested.
39
- The Whitebox-based provider is a pure Java read-only driver. It currently
40
  performs better than the JGrasstools Java-based one.
41

  
42
Both drivers include 2 thinning (simplification) parameters, in order to
43
read a subset of the total available points on the LAS file:
44
- thinningDivisor: reads 1 of every n points (1/n), e.g. thinningDivisor=10
45
  loads 10% of total points
46
- thinningResolution: Loads n points per square map unit, e.g.
47
  thinningResolution=0.0001 loads 0.0001 points/m2 (assumming that the units
48
  of the projection of the example layer are metres), which is the same
49
  as 100 points/km2
50

  
51
Note that thinningDivisor is ignored when thinningResolution is > 0.
52
The thinning is useful to quickly render huge files on smaller scales.
53

  
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/resources-plugin/i18n/text.properties
1
Use_custom_envelope_\(coordinates_using_data_source_projection\)=Use custom envelope \(coordinates using data source projection\)
2
error_creating_properties_panel= Error creando panel de propiedades
3
error_getting_selected_layer_properties = Error al obtener las propiedades de la capas seleccionadas 
4
Do_not_filter_by_envelope=No filtrar por extensi?n geom?trica
5
Use_View_envelope=Usar extensi?n geom?trica de la Vista
6
Use_custom_envelope_\(coordinates_using_data_source_projection\)=Usar extensi?n personalizada \(coordenadas expresadas en la proyecci?n de la fuente de datos\)
7
Filter_by_envelope=Filtrar por extensi?n geom?trica
8
LAS file=Fichero LAS
9
thinningDivisor=Divisor de aclarado de datos
10
thinningResolution=Resoluci?n de aclarado de datos
11
LIDAR LAS file (jgrasstools)=Fichero LIDAR LAS (jgrasstools)
12
LIDAR LAS file (whitebox)=Fichero LIDAR LAS (whitebox)
13
Loads n points per square map unit (e.g. 0.0001 points/m2 on a projected layer or 100 points/km2)=Carga n puntos por unidad cuadrada del mapa (por ejemplo 0.0001 puntos/m2 en una capa proyectada o 100 puntos/km2)
14
Loads only 1 of every n points (1/n), e.g. thinningDivisor=10 loads 10% of total points=Carga ?nicamente 1 de cada n puntos (1/n), por ejemplo thinningDivisor=10 carga el 10% de los puntos totales
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/resources-plugin/i18n/text_en.properties
1
error_creating_properties_panel=Error creating properties panel
2
error_getting_selected_layer_properties = Error getting selected layer properties
3
Do_not_filter_by_envelope=Do not filter by envelope
4
Use_View_envelope=Use View envelope
5
Use_custom_envelope_\(coordinates_using_data_source_projection\)=Use custom envelope \(coordinates expressed using data source projection\)
6
Filter_by_envelope=Filter by envelope
7
LAS file=LAS file
8
thinningDivisor=Thinning divisor
9
thinningResolution=Thinning resolution
10
LIDAR LAS file (jgrasstools)=LIDAR LAS file (jgrasstools)
11
LIDAR LAS file (whitebox)=LIDAR LAS file (whitebox)
12
Loads n points per square map unit (e.g. 0.0001 points/m2 on a projected layer or 100 points/km2)=Loads n points per square map unit (e.g. 0.0001 points/m2 on a projected layer or 100 points/km2)
13
Loads only 1 of every n points (1/n), e.g. thinningDivisor=10 loads 10% of total points=Loads only 1 of every n points (1/n), e.g. thinningDivisor=10 loads 10% of total points
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/resources-plugin/README_es.txt
1
org.gvsig.lidar
2
===============
3

  
4
org.gvsig.lidar es un proveedor de datos para leer y escribir ficheros LAS en
5
gvSIG, siguiendo la especificación de LAS:
6
https://www.asprs.org/committee-general/laser-las-file-format-exchange-activities.html
7

  
8
El plugin está diseñado para funciontar en gvSIG 2.2 y 2.3. Requiere que gvSIG
9
se ejecute con una máquina virtual Java versión 8.0 o superior, ya que las
10
librerías que utiliza requieren Java 8.0.
11

  
12
Los ficheros LAS están diseñados para almacenar nubes de puntos 3D capturados
13
usando sensores LIDAR. Poseen un conjunto de campos obligatorios (fijos) y
14
otros opcionales que dependen de formato de datos de punto que se especifique
15
en la cabecera del fichero LAS.
16

  
17
Los siguientes campos obligatorios se exponen como campos de capa por el
18
proveedor DAL:
19
- CLASSIFICATION (clasificación de coberturas del suelo)
20
- POINTX (coordenada x del punto)
21
- POINTY (coordenada y del punto)
22
- POINTZ (coordenada z del punto, útil para simbolizar elevaciones del terreno)
23
- INTENSITY (intensidad)
24
- RETURNNUM (número de retorno del punto)
25
- NUMBEROFRETURNS (número de retornos para este pulso láser)
26

  
27
Los siguientes campos opcionales se exponen como campos de capa por el
28
proveedor DAL cuando están disponibles en el fichero LAS:
29
- COLOR (color del punto, expresado como un entero "long" de Java que
30
  contiene el valor RGB)
31
- TIME (tiempo absoluto de captura, expresado tal como genera Data.getTime())
32
- WEEKTIME (tiempo relativo de captura, expresado como tiempo GPS semanal)
33

  
34
org.gvsig.lidar proporciona 2 drivers LAS diferentes, basados en 2 librerías
35
diferentes:
36
- El proveedor basado en JGrasstools es un proveedor de lectura/escritura.
37
  Utiliza la librería basada en C libLAS si está disponible en el "library
38
  path" nativo, y utiliza una implementación en Java puro si libLAS no está
39
  disponible o no se ha cargado correctamente. Nótese que sólo se ha probado
40
  la implementación basada en Java.
41
- El proveedor basado en Whitebox es un driver de sólo lectura basado en Java
42
  puro. Actualmente ofrece mejor rendimiento que la implementación Java de
43
  JGrasstools.
44

  
45
Ambos drivers incluyen 2 parámetros de "aclarado" (simplificación), que
46
permiten leer un subconjunto del total de puntos disponibles en el fichero
47
LAS:
48
- thinningDivisor: lee 1 de cada n puntos (1/), por ejemplo thinningDivisor=10
49
  carga el 10% del total de puntos disponibles
50
- thinningResolution: Carga aproximadamente n puntos por unidad cuadrada de
51
  la capa; por ejemplo, thinningResolution=0.0001 carga 0.0001 puntos/m2
52
  (asumiendo que las unidades de la proyección de la capa de ejemplo son
53
  metros), o lo que es lo mismo, 100 puntos/km2
54

  
55
Nótese que el parámetro thinningDivisor no tiene efecto cuando
56
el parámetro thinningResolution es > 0.
57

  
58
El aclarado permite dibujar rápidamente ficheros enormes a pequeñas escalas
59
(en las que no se requiere un nivel de detalle tan elevado como el que
60
provee el fichero).
61

  
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
    <depends plugin-name="org.gvsig.app.mainplugin" />
4
    <depends plugin-name="org.gvsig.exportto.app.mainplugin" />
5
	<libraries library-dir="lib"/>
6
	<resourceBundle name="text"/>
7
	<extensions>
8
		<extension class-name="org.gvsig.lidar.app.mainplugin.LIDARExtension"
9
			description=""
10
			active="true"
11
			priority="1">
12
		</extension>
13
	</extensions>
14
</plugin-config>
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/resources-plugin/images/layer/layer-icon-lidar.svg
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
3
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 355.6 273.5" style="enable-background:new 0 0 355.6 273.5;" xml:space="preserve">
4
<style type="text/css">
5
	.st0{fill:#D80027;}
6
	.st1{fill:#2C3E50;}
7
	.st2{fill:#FFDA44;}
8
</style>
9
<path class="st0" d="M235.3,224l-63.8-87.5c-1-1.7-4.9-3.9-8.7-0.8l-49,46.6c-1.8,1.7-2.3,4.3-1.3,6.6l26.4,60.3l-9.6,9.6  l-39.1-53.6c-1.1-1.5-2.9-2.4-4.7-2.4c-0.4,0-9.3,2.5-13.4-1.3c-2.3-2.2-2.8-6.6-1.5-12c0.5-2.3-0.3-4.7-2.2-6.1l-53.6-39.1l9.6-9.6  l60.3,26.4c2.2,1,4.9,0.4,6.6-1.3l46.6-49c2.2-2,2.2-6.3-0.8-8.7L49.6,38.2l21-21l106.5,46.6c2.3,1,4.9,0.5,6.6-1.3l37.3-39.2  c6.8-7.2,25.1-17.4,36.2-6.8c11.6,11.1,0.2,29.4-6.9,36.2l-39.2,37.2c-1.8,1.7-2.3,4.3-1.3,6.6L256.3,203L235.3,224z"/>
10
<path class="st1" d="M251.7,163.3l-29.6-67.7l36.2-34.4c12.3-10.5,23.3-36.1,7.1-52.9c-16.4-16.9-42.5-4.3-52.9,7L178,51.5L71.6,4.9  c-2.2-1-4.8-0.5-6.5,1.2L36.5,34.8c-3.5,4.1-0.7,7.8,0.7,8.8l87.6,63.9l-39.2,41.2l-60.2-26.3c-2.2-1-4.8-0.5-6.5,1.2L1.6,140.8  c-3,3.5-1.4,7.5,0.7,8.8l56.2,41c-1,7.9,0.8,14.6,5.3,19.1c4.5,4.4,11.2,6.3,19.1,5.3l40.9,56.2c2.8,3.6,6.9,2.4,8.8,0.7l17.2-17.2  c1.7-1.7,2.2-4.3,1.2-6.5L124.8,188l41.2-39.2l63.9,87.6c2.6,3.5,7,2.6,8.8,0.7l28.7-28.6c1.7-1.7,2.2-4.3,1.2-6.5l-11.8-27.1  L251.7,163.3z M235.3,224l-63.8-87.5c-1-1.7-4.9-3.9-8.7-0.8l-49,46.6c-1.8,1.7-2.3,4.3-1.3,6.6l26.4,60.3l-9.6,9.6l-39.1-53.6  c-1.1-1.5-2.9-2.4-4.7-2.4c-0.4,0-9.3,2.5-13.4-1.3c-2.3-2.2-2.8-6.6-1.5-12c0.5-2.3-0.3-4.7-2.2-6.1l-53.6-39.1l9.6-9.6l60.3,26.4  c2.2,1,4.9,0.4,6.6-1.3l46.6-49c2.2-2,2.2-6.3-0.8-8.7L49.6,38.2l21-21l106.5,46.6c2.3,1,4.9,0.5,6.6-1.3l37.3-39.2  c6.8-7.2,25.1-17.4,36.2-6.8c11.6,11.1,0.2,29.4-6.9,36.2l-39.2,37.2c-1.8,1.7-2.3,4.3-1.3,6.6L256.3,203L235.3,224z M235.3,224"/>
11
<g>
12
	<path class="st2" d="M286.1,54.3L268.3,72c11.5,11.5,18.3,27.3,18.3,43.7c0,16.3-6.8,32.1-18.4,43.7l17.8,17.8   C319.6,143.5,319.7,87.9,286.1,54.3L286.1,54.3z"/>
13
	<path class="st2" d="M317.5,22.9l-17.7,17.7c41.1,41.2,41,109.1-0.2,150.2l17.7,17.8C368.3,157.7,368.4,73.9,317.5,22.9L317.5,22.9   z"/>
14
</g>
15
<path class="st1" d="M235.3,224"/>
16
</svg>
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.exportto.swing.prov.lidar.ExporttoLASProviderLibrary
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/assembly/gvsig-plugin-package.xml
1
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2016 
2
	gvSIG Association. This program is free software; you can redistribute it 
3
	and/or modify it under the terms of the GNU General Public License as published 
4
	by the Free Software Foundation; either version 3 of the License, or (at 
5
	your option) any later version. This program is distributed in the hope that 
6
	it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
7
	of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 
8
	Public License for more details. You should have received a copy of the GNU 
9
	General Public License along with this program; if not, write to the Free 
10
	Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
11
	USA. For any additional information, do not hesitate to contact us at info 
12
	AT gvsig.com, or visit our website www.gvsig.com. -->
13
<assembly>
14
	<id>gvsig-plugin-package</id>
15
	<formats>
16
		<format>zip</format>
17
	</formats>
18
	<baseDirectory>${project.artifactId}</baseDirectory>
19
	<includeBaseDirectory>true</includeBaseDirectory>
20
	<files>
21
		<file>
22
			<source>target/${project.artifactId}-${project.version}.jar</source>
23
			<outputDirectory>lib</outputDirectory>
24
		</file>
25
		<file>
26
			<source>target/package.info</source>
27
		</file>
28
	</files>
29

  
30
	<fileSets>
31
		<fileSet>
32
			<directory>src/main/resources-plugin</directory>
33
			<outputDirectory>.</outputDirectory>
34
		</fileSet>
35
	</fileSets>
36

  
37

  
38
	<dependencySets>
39
		<dependencySet>
40
			<useProjectArtifact>false</useProjectArtifact>
41
			<useTransitiveDependencies>false</useTransitiveDependencies>
42
			<outputDirectory>lib</outputDirectory>
43
			<includes>
44
				<include>org.gvsig:org.gvsig.lidar.prov.common</include>
45
				<include>org.gvsig:org.gvsig.lidar.prov.whitebox</include>
46
				<include>org.gvsig:org.gvsig.lidar.prov.jgrass</include>
47
				<include>whitebox:whitebox-api:jar</include>
48
				<include>org.jgrasstools:jgt-jgrassgears</include>
49
				<include>net.java.dev.jna:jna</include>
50
				<include>org.opengis:geoapi</include>
51
			</includes>
52
		</dependencySet>
53

  
54
	</dependencySets>
55

  
56
</assembly>
57

  
58

  
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/lidar/export/service/ExportLASService.java
1
package org.gvsig.lidar.export.service;
2

  
3
import java.io.File;
4
import org.apache.commons.io.FilenameUtils;
5
import org.gvsig.export.ExportException;
6
import org.gvsig.export.ExportLocator;
7
import org.gvsig.export.ExportParametersGeometry;
8
import org.gvsig.export.spi.AbstractExportService;
9
import org.gvsig.export.spi.ExportService;
10
import org.gvsig.export.spi.ExportServiceFactory;
11
import org.gvsig.export.spi.ExportServiceManager;
12
import org.gvsig.fmap.dal.DALLocator;
13
import org.gvsig.fmap.dal.DataManager;
14
import org.gvsig.fmap.dal.DataServerExplorer;
15
import org.gvsig.fmap.dal.NewDataStoreParameters;
16
import org.gvsig.fmap.dal.OpenDataStoreParameters;
17
import org.gvsig.fmap.dal.exception.DataException;
18
import org.gvsig.fmap.dal.feature.EditableFeature;
19
import org.gvsig.fmap.dal.feature.Feature;
20
import org.gvsig.fmap.dal.feature.FeatureSet;
21
import org.gvsig.fmap.dal.feature.FeatureStore;
22
import org.gvsig.fmap.dal.feature.FeatureType;
23
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
24
import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
25
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
26
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
27
import org.gvsig.fmap.geom.Geometry;
28
import org.gvsig.fmap.geom.primitive.Envelope;
29
import org.gvsig.lidar.prov.LASNewStoreParameters;
30
import org.gvsig.lidar.prov.LASOpenStoreParameters;
31
import org.gvsig.lidar.prov.jgrasstools.JGrassLASDataStoreProvider;
32
import org.gvsig.lidar.prov.jgrasstools.JGrassLASWriter;
33
import org.gvsig.tools.dispose.DisposableIterator;
34
import org.gvsig.tools.dispose.DisposeUtils;
35
import org.gvsig.tools.util.HasAFile;
36

  
37
/**
38
 *
39
 * @author jjdelcerro
40
 */
41
public class ExportLASService 
42
        extends AbstractExportService 
43
        implements ExportService 
44
    {
45

  
46
    public ExportLASService(ExportServiceFactory factory, ExportLASParameters parameters) {
47
        super(factory, parameters);
48
    }
49

  
50
    @Override
51
    public ExportLASParameters getParameters() {
52
        return (ExportLASParameters) super.getParameters(); 
53
    }
54

  
55
    @Override
56
    protected DataServerExplorer createServerExplorer() throws ExportException{
57
        
58
        DataManager dataManager = DALLocator.getDataManager();
59

  
60
        FilesystemServerExplorerParameters explorerParams;
61
        try {
62
            explorerParams =
63
                (FilesystemServerExplorerParameters) dataManager
64
                    .createServerExplorerParameters(FilesystemServerExplorer.NAME);
65
        } catch (Exception e) {
66
            throw new ExportException(e);
67
        }
68
        explorerParams.setRoot(this.getParameters().getFile().getParent());
69

  
70
        FilesystemServerExplorer explorer;
71
        try {
72
            explorer = (FilesystemServerExplorer) dataManager.openServerExplorer(
73
                    "FilesystemExplorer", explorerParams
74
            );
75
            return explorer;
76
        } catch (Exception e) {
77
            throw new ExportException(e);
78
        }
79
    }
80

  
81
    @Override
82
    protected LASNewStoreParameters createTargetNewStoreParameters() throws ExportException {
83
        LASNewStoreParameters newStoreParameters = new LASNewStoreParameters(JGrassLASDataStoreProvider.NAME);
84
        newStoreParameters.setFile(getParameters().getFile());
85
        newStoreParameters.setCRS(this.getParameters().getTargetProjection());
86
        return newStoreParameters;
87
    }
88

  
89
    @Override
90
    public LASOpenStoreParameters createTargetOpenStoreParameters() throws ExportException {
91
        try {
92
            DataManager dataManager = DALLocator.getDataManager();
93
            LASOpenStoreParameters openStoreParameters = (LASOpenStoreParameters) dataManager.createStoreParameters(JGrassLASDataStoreProvider.NAME);
94
            ((HasAFile)openStoreParameters).setFile(getParameters().getFile());
95
            openStoreParameters.setDynValue("CRS", this.getParameters().getTargetProjection());
96

  
97
            openStoreParameters.validate();
98
            return openStoreParameters;
99
        } catch (Exception ex) {
100
            throw new ExportException(ex);
101
        }
102
    }
103

  
104
    @Override
105
    public void export(FeatureSet featureSet) throws ExportException {
106
        DataServerExplorer explorer = createServerExplorer();
107
        LASNewStoreParameters newStoreParameters = createTargetNewStoreParameters();
108
        LASOpenStoreParameters openStoreParameters = createTargetOpenStoreParameters();
109

  
110
        String providerName = newStoreParameters.getDataStoreName();
111
        String explorerName = explorer.getProviderName();
112

  
113
        DisposableIterator it = null;
114
        EditableFeature targetFeature = null;
115
        
116
        Envelope outEnvelope = null;
117
        if (coord_trans!=null) {
118
            outEnvelope = this.options.getSource().getEnvelope().convert(coord_trans);
119
        }
120
        else {
121
            outEnvelope = this.options.getSource().getEnvelope();
122
        }
123
            
124
        try {
125
            this.getTaskStatus().setRangeOfValues(0, featureSet.getSize());
126

  
127
            FeatureType theSourceFeatureType = featureSet.getDefaultFeatureType();
128

  
129
            JGrassLASWriter writer = new JGrassLASWriter(
130
                    newStoreParameters, 
131
                    outEnvelope
132
            );            
133
            writer.open();
134
            FeatureType theTargetFeatureType = writer.getFeatureType(
135
                    this.getParameters().getTargetProjection()
136
            );
137

  
138
//            FeatureType theTargetFeatureType = target.getDefaultFeatureType();
139

  
140
            ExportGeometryHelper geomHelper = null;
141
            if (this.getParameters() instanceof ExportParametersGeometry) {
142
                geomHelper = ExportLocator.getServiceManager().createGeometryHelper(
143
                        (ExportParametersGeometry) this.getParameters(),
144
                        theTargetFeatureType,
145
                        theSourceFeatureType
146
                );
147
                if (!geomHelper.canProcessGeometry()) {
148
                    geomHelper = null;
149
                }
150
            }
151
            // ============================================
152

  
153
//            target.edit(FeatureStore.MODE_APPEND);
154
            it = featureSet.fastIterator();
155

  
156
            long featureCount = 0;
157
            while (it.hasNext()) {
158
                this.getTaskStatus().setCurValue(featureCount);
159

  
160
                Feature sourceFeature = (Feature) it.next();
161
//                targetFeature = target.createNewFeature(theTargetFeatureType, true);
162
//                copyValues(sourceFeature, targetFeature);
163
                writer.write(sourceFeature);
164

  
165
                if (geomHelper != null) {
166
                    switch (geomHelper.copyGeometry(sourceFeature, targetFeature)) {
167
                        case ExportServiceManager.FixGeometryStatus.STATE_OK:
168
                            break;
169
                        case ExportServiceManager.FixGeometryStatus.STATE_SKIP:
170
                            continue;
171
                        case ExportServiceManager.FixGeometryStatus.STATE_ABORT:
172
                            throw new InvalidGeometryException(targetFeature, geomHelper.getLastErrorMessage());
173
                    }
174
                }
175

  
176
                target.insert(targetFeature);
177

  
178
                featureCount++;
179

  
180
                if (this.getTaskStatus().isCancellationRequested()) {
181
                    return;
182
                }
183
            }
184
            target.finishEditing();
185
            this.getTaskStatus().terminate();
186
            this.getTaskStatus().remove();
187
            fireFinishedListener();
188
        } catch (Exception e) {
189
            fireCancelledListeners();
190
            throw new ExportException(e, targetFeature);
191
        } finally {
192
            DisposeUtils.dispose(it);
193
            DisposeUtils.dispose(featureSet);
194
            DisposeUtils.dispose(target);
195
        }
196
    }
197

  
198
        
199
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/lidar/export/service/ExportLASParameters.java
1
package org.gvsig.lidar.export.service;
2

  
3
import org.gvsig.export.ExportParametersGeometry;
4
import org.gvsig.fmap.geom.primitive.Envelope;
5
import org.gvsig.tools.util.HasAFile;
6

  
7
/**
8
 *
9
 * @author jjdelcerro
10
 */
11
public interface ExportLASParameters extends ExportParametersGeometry, HasAFile {
12
    
13

  
14
    public static final int POINTFORMAT_BASE = 0;
15
    public static final int POINTFORMAT_TIME = 1;
16
    public static final int POINTFORMAT_COLOR = 2;
17
    public static final int POINTFORMAT_TIME_AND_COLOR = 3;
18
    
19
    public static final int GPSTIME_WEEK = 0;
20
    public static final int GPSTIME_STANDARD = 1;
21

  
22
    public Envelope getFilterEnvelope();
23
    
24
    public void setFilterEnvelope(Envelope envelope);
25

  
26
    public int getPointFormat();
27
    
28
    public void setPointFormat(int pointFormat);
29
    
30
    public int getGPSTimeFormat();
31
    
32
    public void setGPSTimeFormat(int gpsTimeFormat);
33
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/lidar/export/service/ExportLASParametersImpl.java
1
package org.gvsig.lidar.export.service;
2

  
3
import java.io.File;
4
import org.apache.commons.io.FilenameUtils;
5
import org.gvsig.export.spi.AbstractExportParametersGeometry;
6
import org.gvsig.fmap.geom.primitive.Envelope;
7

  
8
/**
9
 *
10
 * @author jjdelcerro
11
 */
12
public class ExportLASParametersImpl
13
        extends AbstractExportParametersGeometry
14
        implements ExportLASParameters
15
    {
16
    private Envelope filterEnvelope;
17
    private File file;
18
    private int pointFormat = POINTFORMAT_TIME_AND_COLOR;
19
    private int gpsTimeFormat = GPSTIME_STANDARD;
20

  
21
    @Override
22
    public String getServiceName() {
23
        return ExportLASServiceFactory.SERVICE_NAME;
24
    }
25

  
26
    @Override
27
    public File getFile() {
28
        return this.file;
29
    }
30

  
31
    @Override
32
    public void setFile(File file) {
33
        this.file = new File(FilenameUtils.removeExtension(file.getAbsolutePath()) + ".las");
34
    }
35

  
36
    @Override
37
    public Envelope getFilterEnvelope() {
38
        return this.filterEnvelope;
39
    }
40

  
41
    @Override
42
    public void setFilterEnvelope(Envelope envelope) {
43
        this.filterEnvelope = envelope;
44
    }
45
    
46
    @Override
47
    public int getPointFormat() {
48
        return this.pointFormat;
49
    }
50
    
51
    @Override
52
    public void setPointFormat(int pointFormat) {
53
        this.pointFormat = pointFormat;
54
    }
55
    
56
    @Override
57
    public int getGPSTimeFormat() {
58
        return this.gpsTimeFormat;
59
    }
60
    
61
    @Override
62
    public void setGPSTimeFormat(int gpsTimeFormat) {
63
        this.gpsTimeFormat = gpsTimeFormat;
64
    }    
65
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/lidar/export/service/ExportLASServiceFactory.java
1
package org.gvsig.lidar.export.service;
2

  
3
import org.gvsig.export.ExportParameters;
4
import org.gvsig.export.spi.AbstractExportServiceFactory;
5

  
6
/**
7
 *
8
 * @author jjdelcerro
9
 */
10
public class ExportLASServiceFactory 
11
        extends AbstractExportServiceFactory 
12
    {
13

  
14
    public static final String SERVICE_NAME = "LAS";
15
    
16
    public ExportLASServiceFactory() {
17
        super(
18
                SERVICE_NAME,
19
                "_LAS_file_format_for_LIDAR_data", // LAS, formato de fichero para datos LiDAR
20
                "LAS, file format for LiDAR data, developed by the American Society for Photogrammetry & Remote Sensing (ASPRS)"
21
        );
22
    }
23

  
24
    @Override
25
    public ExportLASService createService(ExportParameters parameters) {
26
        ExportLASService service = new ExportLASService(this, (ExportLASParameters) parameters);
27
        return service;
28
    }
29

  
30
    @Override
31
    public ExportLASParameters createParameters() {
32
        ExportLASParameters parameters = new ExportLASParametersImpl();
33
        return parameters;
34
    }
35

  
36
    @Override
37
    public boolean hasTabularSupport() {
38
        return true;
39
    }
40

  
41
    @Override
42
    public boolean hasVectorialSupport() {
43
        return true;
44
    }
45
    
46
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/exportto/swing/panel/SelectEnvelopePanel.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2016 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23

  
24
package org.gvsig.exportto.swing.panel;
25

  
26
import java.awt.Color;
27
import java.awt.GridBagConstraints;
28
import java.awt.GridBagLayout;
29
import java.awt.Insets;
30

  
31
import javax.swing.BorderFactory;
32
import javax.swing.ButtonGroup;
33
import javax.swing.JPanel;
34
import javax.swing.JRadioButton;
35

  
36
import org.cresques.cts.ICoordTrans;
37
import org.gvsig.fmap.geom.Geometry;
38
import org.gvsig.fmap.geom.GeometryLocator;
39
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
40
import org.gvsig.fmap.geom.primitive.Envelope;
41
import org.gvsig.fmap.mapcontext.MapContext;
42
import org.gvsig.gui.beans.coordinatespanel.CoordinatesPanel;
43
import org.gvsig.tools.ToolsLocator;
44
import org.gvsig.tools.i18n.I18nManager;
45
import org.gvsig.tools.locator.LocatorException;
46

  
47
/**
48
 * A panel to select an envelope from different options:
49
 * - original data source envelope
50
 * - visible extent of the provided View (MapContext)
51
 * - user defined Envelope
52
 */
53
public class SelectEnvelopePanel extends JPanel {
54
	I18nManager trans = ToolsLocator.getI18nManager();
55

  
56
	private JRadioButton btnOriginalEnvelope = null;
57
	private JRadioButton btnViewEnvelope = null;
58
	private JRadioButton btnUserDefinedEnvelope = null;
59
	private ButtonGroup group = null;
60

  
61
	private CoordinatesPanel btnPnlDefinedEnvelope;
62

  
63
	private MapContext mapContext = null;
64
	private ICoordTrans viewTolayerCT = null;
65

  
66
	private static final long serialVersionUID = 4179360502906000062L;
67

  
68
	/**
69
	 * When using this constructor, the View extent will not be
70
	 * available.
71
	 */
72
	public SelectEnvelopePanel() {
73
		initComponents();
74
	}
75

  
76
    /**
77
     * Preferred constructor.
78
     * 
79
     * @param mapcontext The MapContext to get the View envelope
80
     * @param viewTolayerCT A coordinate transform to transform the
81
     * view envelope from view projection coordinates to layer
82
     * projection coordinates. Can be set to null if layer and view
83
     * have the same projection.
84
     */
85
	public SelectEnvelopePanel(MapContext mapContext, ICoordTrans viewTolayerCT) {
86
		this.mapContext = mapContext;
87
		this.viewTolayerCT = viewTolayerCT;
88
		initComponents();
89
	}
90
	
91
	private void initComponents() {
92
		this.setLayout(new GridBagLayout());
93
		group = new ButtonGroup();
94
		GridBagConstraints constraints = new GridBagConstraints();
95
		constraints.gridx = 0;
96
		constraints.gridy = 0;
97
		constraints.anchor = GridBagConstraints.WEST;
98
		constraints.fill = GridBagConstraints.HORIZONTAL;
99
		constraints.insets = new Insets(5, 5, 5, 5);
100
		this.add(getBtnOriginalEnvelope(), constraints);
101
		getBtnOriginalEnvelope().setSelected(true);
102
		if (mapContext!=null) {
103
			constraints.gridy++;
104
			this.add(getBtnViewEnvelope(), constraints);
105
		}
106
		constraints.gridy++;
107
		this.add(getBtnUserDefinedEnvelope(), constraints);
108
		constraints.gridy++;
109
		constraints.ipadx = 30;
110
		this.add(getPnlUserDefinedEnvelope(), constraints);
111
	}
112
	
113
	private JRadioButton getBtnOriginalEnvelope() {
114
		if (btnOriginalEnvelope==null) {
115
			String text = trans.getTranslation("Do_not_filter_by_envelope");
116
			btnOriginalEnvelope  = new JRadioButton(text);
117
			group.add(btnOriginalEnvelope);
118
		}
119
		return btnOriginalEnvelope;
120
	}
121
	
122
	private JRadioButton getBtnViewEnvelope() {
123
		if (btnViewEnvelope==null) {
124
			String text = trans.getTranslation("Use_View_envelope");
125
			btnViewEnvelope  = new JRadioButton(text);
126
			group.add(btnViewEnvelope);
127
		}
128
		return btnViewEnvelope;
129
	}
130
	
131
	private JRadioButton getBtnUserDefinedEnvelope() {
132
		if (btnUserDefinedEnvelope==null) {
133
			String text = trans.getTranslation("Use_custom_envelope_(coordinates_using_data_source_projection)");
134
			btnUserDefinedEnvelope  = new JRadioButton(text);
135
			group.add(btnUserDefinedEnvelope);
136
		}
137
		return btnUserDefinedEnvelope;
138
	}
139
	
140
	private CoordinatesPanel getPnlUserDefinedEnvelope() {
141
		if (btnPnlDefinedEnvelope==null) {
142
			btnPnlDefinedEnvelope = new CoordinatesPanel();
143
		}
144
		return btnPnlDefinedEnvelope;
145
	}
146
	
147
	
148
	public Envelope getEnvelope() {
149
		if (getBtnViewEnvelope().isSelected()) {
150
			if (this.mapContext!=null) {
151
				Envelope envelope = this.mapContext.getViewPort().getEnvelope();
152
				if (viewTolayerCT!=null) {
153
					envelope = envelope.convert(viewTolayerCT);
154
				}
155
				return envelope;
156
			}
157
		}
158
		else if (getBtnUserDefinedEnvelope().isSelected()){
159
	    	double minX = string2double(getPnlUserDefinedEnvelope().getValue11());
160
	    	double minY = string2double(getPnlUserDefinedEnvelope().getValue22());
161
	    	double maxX = string2double(getPnlUserDefinedEnvelope().getValue21());
162
	    	double maxY = string2double(getPnlUserDefinedEnvelope().getValue12());
163
	    	try {
164
				return GeometryLocator.getGeometryManager().createEnvelope(minX, minY, maxX, maxY, Geometry.SUBTYPES.GEOM2D);
165
			} catch (LocatorException e) {
166
				// TODO Auto-generated catch block
167
				e.printStackTrace();
168
			} catch (CreateEnvelopeException e) {
169
				// TODO Auto-generated catch block
170
				e.printStackTrace();
171
			}
172
		}
173
    	return null;
174
    }
175
	
176
    /**
177
     * Tries to parse a string as a double 
178
     * @return
179
     */
180
    public double string2double(String strDouble) {
181
    	try {
182
    		return Double.valueOf(strDouble).doubleValue();
183
    	}
184
    	catch (Exception e) {}
185
    	// assume comma was used as decimal separator
186
    	String replaced = strDouble.replaceAll(".", "");
187
    	replaced = replaced.replaceAll(",", ".");
188
    	try {
189
    		return Double.valueOf(strDouble).doubleValue();
190
    	}
191
    	catch (Exception e) {}
192
    	
193
    	// return 0.0 if no valid number could be decoded
194
    	return 0.0d;
195
    }
196
	
197
	
198

  
199
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/exportto/swing/panel/SelectEnvelopeOptionPanel.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2016 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.exportto.swing.panel;
24

  
25
import java.awt.BorderLayout;
26
import java.awt.Component;
27
import java.io.File;
28

  
29
import javax.swing.JComponent;
30
import javax.swing.JOptionPane;
31
import javax.swing.JPanel;
32

  
33
import org.cresques.cts.ICoordTrans;
34
import org.cresques.cts.IProjection;
35
import org.gvsig.app.ApplicationLocator;
36
import org.gvsig.app.project.documents.Document;
37
import org.gvsig.app.project.documents.view.BaseViewDocument;
38
import org.gvsig.exportto.swing.ExporttoSwingLocator;
39
import org.gvsig.exportto.swing.ExporttoSwingManager;
40
import org.gvsig.exportto.swing.spi.ExporttoPanelValidationException;
41
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderPanel;
42
import org.gvsig.fmap.dal.exception.DataException;
43
import org.gvsig.fmap.dal.feature.FeatureStore;
44
import org.gvsig.fmap.geom.Geometry;
45
import org.gvsig.fmap.geom.GeometryLocator;
46
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
47
import org.gvsig.fmap.geom.primitive.Envelope;
48
import org.gvsig.fmap.mapcontext.MapContext;
49
import org.gvsig.gui.beans.coordinatespanel.CoordinatesPanel;
50
import org.gvsig.i18n.Messages;
51
import org.gvsig.tools.locator.LocatorException;
52

  
53
/**
54
 * @author gvSIG Team
55
 * @version $Id$
56
 * 
57
 */
58
public class SelectEnvelopeOptionPanel extends JPanel implements ExporttoSwingProviderPanel {
59
	private static final long serialVersionUID = -729071840887099236L;
60

  
61
	private JPanel optionsPanel;
62

  
63
    private static final ExporttoSwingManager EXPORTTO_SWING_MANAGER =
64
        ExporttoSwingLocator.getSwingManager();
65

  
66
    private SelectEnvelopePanel panel;
67

  
68
    /**
69
     * @param dataSourceSRS Data source SRS, used to transform the View
70
     * envelope to the data source projection, if View and data source
71
     * use different projection
72
     */
73
    public SelectEnvelopeOptionPanel(IProjection dataSourceSRS) {
74
        this(dataSourceSRS, null);
75
    }
76

  
77
    /**
78
     * @param dataSourceSRS Data source SRS, used to transform the View
79
     * envelope to the data source projection, if View and data source
80
     * use different projection
81
     */
82
    public SelectEnvelopeOptionPanel(IProjection dataSourceSRS, JPanel optionsPanel) {
83
        super();
84
        this.setLayout(new BorderLayout());
85
        Document d = ApplicationLocator.getManager().getActiveDocument();
86
        if (d instanceof BaseViewDocument) {
87
        	BaseViewDocument view = (BaseViewDocument) d;
88
        	MapContext mc = view.getMapContext();
89
        	ICoordTrans viewTolayerCT = getViewToSourceCoordTrans(dataSourceSRS, mc.getProjection());
90
        	panel = new SelectEnvelopePanel(view.getMapContext(), viewTolayerCT);
91
        }
92
        else {
93
        	panel = new SelectEnvelopePanel();
94
        }
95
        
96
        add(panel, BorderLayout.NORTH);
97
        if (optionsPanel != null) {
98
            optionsPanel.setBorder(javax.swing.BorderFactory
99
                .createCompoundBorder(javax.swing.BorderFactory
100
                    .createTitledBorder(Messages.getText("options")),
101
                    javax.swing.BorderFactory.createEmptyBorder(10, 5, 5, 5)));
102
            add(optionsPanel, BorderLayout.CENTER);
103
            this.optionsPanel = optionsPanel;
104
        }
105
    }
106
    
107
    protected ICoordTrans getViewToSourceCoordTrans(IProjection sourceSrs,
108
    		IProjection viewSrs) {
109
    	ICoordTrans trans = null;
110
    	try {
111
			/***
112
			 * We get the CT from the sourceSRS and then then inverted because
113
			 * data source to View transform is usually stored in the sourceSrs
114
			 * and not in the view SRS
115
			 */
116
			trans = sourceSrs.getCT(viewSrs).getInverted();
117
		} catch (Exception e) {}
118
    	return trans;
119
    }
120

  
121
    public String getPanelTitle() {
122
        return EXPORTTO_SWING_MANAGER.getTranslation("Filter_by_envelope");
123
    }
124

  
125
    public Envelope getEnvelope() {
126
    	
127
    	return panel.getEnvelope();
128
    }
129

  
130
    public void enterPanel() {
131
        // Default do nothing
132
    }
133
    
134
    public boolean isValidPanel() throws ExporttoPanelValidationException {
135
        return true;
136
    }
137

  
138
    /**
139
     * @return the optionsPanel
140
     */
141
    public JPanel getOptionsPanel() {
142
        return optionsPanel;
143
    }
144

  
145
    public JComponent asJComponent() {
146
        return this;
147
    }
148
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/exportto/swing/prov/lidar/ExporttoLASProvider.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2016 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.exportto.swing.prov.lidar;
24

  
25
import java.io.File;
26
import java.util.ArrayList;
27
import java.util.List;
28

  
29
import org.cresques.cts.ICoordTrans;
30
import org.cresques.cts.IProjection;
31
import org.gvsig.exportto.ExporttoService;
32
import org.gvsig.exportto.swing.panel.SelectEnvelopeOptionPanel;
33
import org.gvsig.exportto.swing.prov.file.AbstractExporttoFileProvider;
34
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderPanel;
35
import org.gvsig.fmap.dal.exception.DataException;
36
import org.gvsig.fmap.dal.feature.FeatureStore;
37
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
38
import org.gvsig.fmap.geom.primitive.Envelope;
39
import org.gvsig.tools.service.spi.ProviderServices;
40
import org.slf4j.Logger;
41
import org.slf4j.LoggerFactory;
42
import org.gvsig.exportto.swing.prov.lidar.ExporttoLASService;
43

  
44
/**
45
 * Exporto provider which gets Exporto from a file.
46
 *
47
 * @author <a href="mailto:cmartinez@scolab.es">Cesar Martinez Izquierdo</a>
48
 */
49
public class ExporttoLASProvider extends AbstractExporttoFileProvider
50
        implements ExporttoLASOptions {
51

  
52
    private static Logger logger = LoggerFactory.getLogger(
53
            ExporttoLASProvider.class);
54

  
55
    protected List<ExporttoSwingProviderPanel> panels = new ArrayList<ExporttoSwingProviderPanel>();
56
    
57
    private String storeName = null;
58
    protected SelectEnvelopeOptionPanel envelopePanel;
59
    
60
    public ExporttoLASProvider(ProviderServices providerServices,
61
            FeatureStore sourceStore, IProjection targetProjection) {
62
    	super(providerServices, sourceStore, targetProjection);
63
    	IProjection sourceProjection = getSourceSrs(sourceStore);
64
    	envelopePanel = new SelectEnvelopeOptionPanel(sourceProjection);
65
    }
66
    
67
    protected IProjection getSourceSrs(FeatureStore sourceStore) {
68
    	try {
69
    		return sourceStore.getDefaultFeatureType().getDefaultGeometryAttribute().getSRS();
70
    	} catch (Exception e) {}
71
    	return null;
72
    }
73

  
74
    public int getPanelCount() {
75
    	return super.getPanelCount()+1;
76
        //return this.panels.size();
77
    }
78

  
79
    public ExporttoSwingProviderPanel getPanelAt(int index) {
80
    	if (super.getPanelCount()>index) {
81
    		return super.getPanelAt(index);	
82
    	}
83
    	else {
84
    		return envelopePanel;
85
    	}
86
    }
87

  
88
    public FeatureStore getSource() {
89
        return this.featureStore;
90
    }
91

  
92
    public ExporttoService createExporttoService() {
93
        return new ExporttoLASService(this);
94
    }
95

  
96
    public FilesystemServerExplorerParameters getExplorerParameters() {
97
    	return null;
98
        // CMI return this.connectionPanel.getServerExplorerParameters();
99
    }
100

  
101

  
102

  
103
	public File getOutputFile() {
104
		return this.selectFileOptionPanel.getSelectedFile();
105
	}
106

  
107

  
108

  
109
	public IProjection getTargetProjection() {
110
		return this.projection;
111
	}
112

  
113

  
114
	public Envelope getFilterEnvelope() {
115
		return this.envelopePanel.getEnvelope();
116
	}    
117
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/exportto/swing/prov/lidar/ExporttoLASOptions.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2016 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23

  
24
package org.gvsig.exportto.swing.prov.lidar;
25

  
26
import java.io.File;
27

  
28
import org.cresques.cts.IProjection;
29
import org.gvsig.fmap.dal.feature.FeatureStore;
30
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
31
import org.gvsig.fmap.geom.primitive.Envelope;
32

  
33

  
34
/**
35
 *
36
 * @author <a href="mailto:cmartinez@scolab.es">Cesar Martinez Izquierdo</a>
37
 */
38
public interface ExporttoLASOptions  {
39

  
40
    public FilesystemServerExplorerParameters getExplorerParameters();
41
    
42
    public File getOutputFile();
43
    
44
    public FeatureStore getSource();
45
    
46
    public IProjection getTargetProjection();
47
    
48
    public Envelope getFilterEnvelope();
49
    
50
}
org.gvsig.lidar/tags/org.gvsig.lidar-1.0.125/org.gvsig.lidar.app/org.gvsig.lidar.app.export/src/main/java/org/gvsig/exportto/swing/prov/lidar/ExporttoLASProviderLibrary.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2016 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.exportto.swing.prov.lidar;
24

  
25
import org.gvsig.exportto.swing.ExporttoSwingLibrary;
26
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderLocator;
27
import org.gvsig.fmap.dal.DALLibrary;
28
import org.gvsig.tools.ToolsLocator;
29
import org.gvsig.tools.i18n.I18nManager;
30
import org.gvsig.tools.library.AbstractLibrary;
31
import org.gvsig.tools.library.LibraryException;
32
import org.gvsig.tools.service.spi.ProviderManager;
33

  
34
/**
35
 * @author <a href="mailto:cmartinez@scolab.es">Cesar Martinez Izquierdo</a>
36
 *
37
 */
38
public class ExporttoLASProviderLibrary extends AbstractLibrary {
39

  
40
    @Override
41
    public void doRegistration() {
42
        registerAsServiceOf(ExporttoSwingLibrary.class);
43
        require(DALLibrary.class);
44
        require(ExporttoSwingLibrary.class);
45
    }
46

  
47
    @Override
48
    protected void doInitialize() throws LibraryException {
49
        I18nManager i18nManager = ToolsLocator.getI18nManager();
50
        i18nManager.addResourceFamily(
51
                "org.gvsig.exportto.swing.prov.lidar",
52
                ExporttoLASProviderLibrary.class.getClassLoader(),
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff