<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Domingo Baeza D&iacute;az escribi&oacute;:
<blockquote cite="mid:4AAE52BA.9050500@blom.es" type="cite">Buenas
tardes.<br>
  <br>
Gracias por las respuestas de como acceder a los datos del shape. Y
tambi&eacute;n por indicarme que la parte correspondiente a la persistencia
(guardado del gvp) est&aacute; en desarrollo.<br>
  <br>
Estoy migrando una aplicaci&oacute;n de la 1.1 a la 2.0 y lo que estoy en
principio es cogiendo las funcionalidades GIS y adaptandolas a la
versi&oacute;n 2.0<br>
  <br>
El problema que me surge ahora es que mediante c&oacute;digo hago una carga de
un shape para que aparezca en una vista, y sin problema lo hago
mediante este c&oacute;digo<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <small>FLyrVect lyr = null;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SHPStoreParameters shpParameters = null;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DALFileLibrary libFile = new DALFileLibrary();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; libFile.initialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DefaultGeometryLibrary defGeomLib = new
DefaultGeometryLibrary();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; defGeomLib.initialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ProjectionLibrary projLib = new ProjectionLibrary();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; projLib.initialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; org.gvsig.fmap.dal.store.shp.SHPLibrary shpLib = new
SHPLibrary();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shpLib.initialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JTSIndexLibrary jtsIndex = new JTSIndexLibrary();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; jtsIndex.initialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; defGeomLib.postInitialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; projLib.postInitialize();<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; libFile.postInitialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shpLib.postInitialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; jtsIndex.postInitialize();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DataManager dataManager=null;<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; File file=new
File("C:\\tmp\\Pruebas\\Shapes\\ARBOLADO..shp");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dataManager=DALLocator.getDataManager();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shpParameters = null;<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shpParameters = (SHPStoreParameters)
dataManager.createStoreParameters(SHPStoreProvider.NAME);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shpParameters.setFile(file);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shpParameters.setSRSID("EPSG:32630");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String layerName="ARBOLADO.shp";<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; View vista = (View)
PluginServices.getMDIManager().getActiveWindow();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ProjectView model = (ProjectView) vista.getModel();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MapContext mapa = model.getMapContext();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MapControl mapCtrl = vista.getMapControl();<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
  <b>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
lyr=(FLyrVect)LayerFactory.getInstance().createLayer(layerName,
shpParameters);</b><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (LoadLayerException e) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated catch block<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.printStackTrace();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lyr.setVisible(true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lyr.setActive(true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lyr.setProjection(mapCtrl.getProjection());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<b>&nbsp; &nbsp;&nbsp;&nbsp; mapCtrl.getMapContext().getLayers().addLayer(lyr);</b><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (InitializeException e1) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated catch block<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e1.printStackTrace();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (ProviderNotRegisteredException e1) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated catch block<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e1.printStackTrace();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</small><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
Pero despu&eacute;s voy a pedir informaci&oacute;n con el bot&oacute;n de Informaci&oacute;n y me
aparece el siguiente mensaje:<br>
  <br>
ERROR [AWT-EventQueue-1] (NotificationManager.java:105) -
PluginServices.Error grave de la aplicaci&oacute;n.&nbsp; <br>
&nbsp;Es conveniente que salgas de la aplicaci&oacute;n<br>
  <b>java.lang.UnsatisfiedLinkError: no crsjniproj2.0.0 in
java.library.path</b><br>
&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)<br>
&nbsp;&nbsp;&nbsp; at java.lang.Runtime.loadLibrary0(Runtime.java:822)<br>
&nbsp;&nbsp;&nbsp; at java.lang.System.loadLibrary(System.java:993)<br>
&nbsp;&nbsp;&nbsp; at org.gvsig.crs.proj.JNIBaseCrs.&lt;clinit&gt;(JNIBaseCrs.java:78)<br>
&nbsp;&nbsp;&nbsp; a-------<br>
&nbsp;&nbsp;&nbsp; at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)<br>
&nbsp;&nbsp;&nbsp; at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)<br>
&nbsp;&nbsp;&nbsp; at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)<br>
Pero si cargo manualmente la capa el bot&oacute;n de informaci&oacute;n funciona
correctamente<br>
  <br>
Gracias y un saludo<br>
  <div class="moz-signature">-- <br>
&nbsp;<br>
  <p><b><span
 style="font-size: 9pt; color: rgb(127, 127, 0); font-family: 'Arial','sans-serif';"
 lang="EN-US">Domingo Baeza D&iacute;az<br>
  </span></b> <img alt="Blom"
 src="cid:part1.04020806.06070209@prodevelop.es" height="67" width="144"><br>
  <span
 style="font-size: 7.5pt; color: rgb(127, 127, 127); font-family: 'Arial','sans-serif';"
 lang="EN-US"> Ps. Arco de Ladrillo, 90 2 Planta - Edif. Centro Madrid <br>
47008 Valladolid - Espa&ntilde;a<br>
TEL.+34 983 45 60 48 FAX.+34 983 23 96 49<br>
e-mail:<a moz-do-not-send="true" href="mailto:dbaeza@blom.es"
 title="mailto:dbaeza@blom.es"> <span style="color: blue;">dbaeza@blom.es</span></a></span></p>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
gvSIG_desarrolladores mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gvSIG_desarrolladores@listserv.gva.es">gvSIG_desarrolladores@listserv.gva.es</a>
<a class="moz-txt-link-freetext" href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</a>
  </pre>
</blockquote>
Hola Domingo,<br>
Cargas la capa correctamente y le asignas la proyecci&oacute;n como par&aacute;metro
a mano.<br>
No he probado a&uacute;n a meterme con el funcionamiento de la librer&iacute;a Proj4
en gvSIG 2.0, pero est&aacute; claro que lo que te est&aacute; fallando es el JNI que
interactua con la librer&iacute;a, ya sea por un fallo de proj4 con esa
proyecci&oacute;n, como por el JNI que no est&eacute; adaptado correctamente a la
recompilaci&oacute;n de la libreria C para tu SO.<br>
Las preguntas para depurar ese error ser&aacute;n: <br>
<br>
-El SO que usas tiene una versi&oacute;n de proj4 dll o so compilado con un
JNI adaptado, puede ocurrir que&nbsp; si no hay libreria proj4 compilada
para &eacute;l y si el JNI que te puedes descargar en el branch del svn no
est&aacute;n adaptados a los cambios falle toda la aplicaci&oacute;n (tocar&aacute;
depurarlos).<br>
<br>
-La proyecci&oacute;n que usas ha de estar soportada por proj4. En este caso
era <small>EPSG:32630.<br>
</small><br>
-Asegurate que las librerias est&aacute;n bien enlazadas por los JNI. han de
estar accesibles desde la carpeta correspondiente dentro de
"build/product".<br>
<br>
Seguramente se necesite comprobar muchas m&aacute;s cosas.<br>
<br>
Suerte. Espero que te ayude.<br>
<small>&nbsp;</small><br>
<div class="moz-signature">-- <br>
<meta http-equiv="CONTENT-TYPE" content="text/html; ">
<title></title>
<meta name="GENERATOR" content="OpenOffice.org 3.0  (Linux)">
<meta name="CREATED" content="20090902;17342800">
<meta name="CHANGED" content="20090902;18181900">
<meta name="Informaci&oacute;n 1" content="">
<meta name="Informaci&oacute;n 2" content="">
<meta name="Informaci&oacute;n 3" content="">
<meta name="Informaci&oacute;n 4" content="">
<style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
                A:link { so-language: zxx }
        -->
        </style>
<pre style="text-align: left;"><font face="AlMateen"><font
 style="font-size: 11pt;" size="2">        <font style="font-size: 13pt;"
 size="3">Carlos S&aacute;nchez Peri&ntilde;&aacute;n</font></font></font>
<font face="AlMateen"><font color="#808080">        Equipo desarrollo</font> <font
 color="#666666">GIS</font></font>
<font color="#666699"><font face="AlMateen"><font size="4">        <font
 style="font-size: 16pt;" size="4">Prodevelop S.L.</font></font></font></font>
<font face="AlMateen">        <font color="#808080"><font
 style="font-size: 10pt;" size="2">Tel</font></font><font
 style="font-size: 10pt;" size="2"> :  963510612</font></font>
<font face="AlMateen">        </font><font color="#808080"><font
 face="AlMateen">E-mail</font></font><font face="AlMateen"> : </font><a
 href="mailto:csanchez@prodevelop.es"><font face="Electron"><font
 style="font-size: 8pt;" size="1"><b>csanchez@prodevelop.es</b></font></font></a>
</pre>
<p style="margin-bottom: 0cm;"><br>
</p>
</div>
</body>
</html>