Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Monday, 29 September 2014

Verify the GIS data

EXECUTE SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('LB_BLOCKS_GIS','SHAPE','RANDOM_POINT_RESULTS',2);
--CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('LB_BUILDINGS_GIS','SHAPE','RANDOM_POINT_RESULTS');

select
  *
from
  LB_BLOCKS_GIS A, RANDOM_POINT_RESULTS B
where
  A.ROWID = B.SDO_ROWID;
 
  select * from RANDOM_POINT_RESULTS;
 
 
 
 






UPDATE user_sdo_geom_metadata
   SET diminfo = ( SELECT MDSYS.SDO_DIM_ARRAY(
                                MDSYS.SDO_DIM_ELEMENT('X', minx, maxx, 0.001),
                                MDSYS.SDO_DIM_ELEMENT('Y', miny, maxy, 0.001)) as diminfo
                     FROM ( SELECT TRUNC( MIN( v.x ) - 1,0) as minx,
                                   ROUND( MAX( v.x ) + 1,0) as maxx,
                                   TRUNC( MIN( v.y ) - 1,0) as miny,
                                   ROUND( MAX( v.y ) + 1,0) as maxy
                              FROM (SELECT SDO_AGGR_MBR(a.shape) as mbr
                                      FROM LB_QUARTERS_GIS a) b,
                                           TABLE(mdsys.sdo_util.getvertices(b.mbr)) v
                           )
                 )
 WHERE table_name = 'LB_ROADS_GIS_R';
 commit;
 
 
   delete from user_sdo_geom_metadata
   where table_name='LB_ROADS_GIS_R'
   ;
 
   --MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT(NULL,152796.6044,154204.896,0.001),MDSYS.SDO_DIM_ELEMENT(NULL,100965.676000001,102023.5385,0.001))
   --MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',152795,154206,0.001),MDSYS.SDO_DIM_ELEMENT('Y',100964,102025,0.001))

Tuesday, 4 September 2012

Android; Read file from Assets into Byte Array

Sometimes you want to place an encrypted file in the assets folder, and you want to read it in correct and unencrypted, so, you want to read it into byte array and edit the byte array to the correct format, here is the way


InputStream is=getAssets().open("fileName.extension");
byte[] fileBytes=new byte[is.available()];
is.read( fileBytes);
is.close();

Now you edit the byte array as you want, and you can create original file with the current bytes if it was encrypted



Mohammad Abu Hmead