Revision 2357 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/px/PxRaster.java

View differences:

PxRaster.java
420 420
				else
421 421
					maxy = lastViewPort.getExtent().getMax().getY();
422 422
				
423
				//Comprobamos que estemos dentro del extent del Image
424
				if(wcx < minx || wcx > maxx || wcy < miny || wcy > maxy){
425
					int[] res = {-1, -1, -1, -1};
426
					return res;
427
				}
428
				
423 429
				//Pasamos a coordenadas del Image las coordenadas del mundo real
424 430
				int w = ((BufferedImage)geoImage).getWidth();
425 431
				int h = ((BufferedImage)geoImage).getHeight();
......
427 433
				double wch = maxy-miny;
428 434
				ptox = (int)(((wcx-minx)*w)/wcw);
429 435
				ptoy = (int)(((wcy-miny)*h)/wch);
430
				System.out.println("Orto --> "+extOrtofoto.minX()+" "+extOrtofoto.maxX()+" "+extOrtofoto.minY()+" "+extOrtofoto.maxY());
431
				System.out.println("View --> "+lastViewPort.getExtent().getMin().getX()+" "+lastViewPort.getExtent().getMax().getX()+" "+lastViewPort.getExtent().getMin().getY()+" "+lastViewPort.getExtent().getMax().getY());
432
				System.out.println("Img --> "+minx+" "+maxx+" "+miny+" "+maxy);
433
				System.out.println("--> ptox="+ptox+" ptoy="+ptoy+" wcx="+wcx+" wcy="+wcy+" wcw="+wcw+" wch="+wch);
434 436
				
435 437
				//Obtenemos el pto seleccionado del Image y extraemos el RGB
436 438
				int px = ((BufferedImage)geoImage).getRGB(ptox, h-ptoy);

Also available in: Unified diff