idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
17,200
public void goTo ( Sector sector , boolean animate ) { View view = getWwd ( ) . getView ( ) ; view . stopAnimations ( ) ; view . stopMovement ( ) ; if ( sector == null ) { return ; } Box extent = Sector . computeBoundingBox ( getWwd ( ) . getModel ( ) . getGlobe ( ) , getWwd ( ) . getSceneController ( ) . getVerticalEx...
Move to see a given sector .
17,201
public void setFlatGlobe ( boolean doMercator ) { EarthFlat globe = new EarthFlat ( ) ; globe . setElevationModel ( new ZeroElevationModel ( ) ) ; wwd . getModel ( ) . setGlobe ( globe ) ; wwd . getView ( ) . stopMovement ( ) ; GeographicProjection projection ; if ( doMercator ) { projection = new ProjectionMercator ( ...
Set the globe as flat .
17,202
public void setSphereGlobe ( ) { Earth globe = new Earth ( ) ; wwd . getModel ( ) . setGlobe ( globe ) ; wwd . getView ( ) . stopMovement ( ) ; wwd . redraw ( ) ; }
Set the globe as sphere .
17,203
public void setFlatSphereGlobe ( ) { Earth globe = new Earth ( ) ; globe . setElevationModel ( new ZeroElevationModel ( ) ) ; wwd . getModel ( ) . setGlobe ( globe ) ; wwd . getView ( ) . stopMovement ( ) ; wwd . redraw ( ) ; }
Set the globe as flat sphere .
17,204
public List < Message > getFilteredList ( EMessageType messageType , Long fromTsMillis , Long toTsMillis , long limit ) throws Exception { String tableName = TABLE_MESSAGES ; String sql = "select " + getQueryFieldsString ( ) + " from " + tableName ; List < String > wheresList = new ArrayList < > ( ) ; if ( messageType ...
Get the list of messages filtered .
17,205
public boolean accept ( File file ) { String name = file . getName ( ) ; if ( FilenameUtils . wildcardMatch ( name , wildcards , caseSensitivity ) ) { return true ; } return false ; }
Checks to see if the filename matches one of the wildcards .
17,206
public SimpleFeature convertDwgAttribute ( String typeName , String layerName , DwgAttrib attribute , int id ) { Point2D pto = attribute . getInsertionPoint ( ) ; Coordinate coord = new Coordinate ( pto . getX ( ) , pto . getY ( ) , attribute . getElevation ( ) ) ; String textString = attribute . getText ( ) ; return c...
Builds a point feature from a dwg attribute .
17,207
public SimpleFeature convertDwgPolyline2D ( String typeName , String layerName , DwgPolyline2D polyline2d , int id ) { Point2D [ ] ptos = polyline2d . getPts ( ) ; CoordinateList coordList = new CoordinateList ( ) ; if ( ptos != null ) { for ( int j = 0 ; j < ptos . length ; j ++ ) { Coordinate coord = new Coordinate (...
Builds a line feature from a dwg polyline 2D .
17,208
public SimpleFeature convertDwgPoint ( String typeName , String layerName , DwgPoint point , int id ) { double [ ] p = point . getPoint ( ) ; Point2D pto = new Point2D . Double ( p [ 0 ] , p [ 1 ] ) ; CoordinateList coordList = new CoordinateList ( ) ; Coordinate coord = new Coordinate ( pto . getX ( ) , pto . getY ( )...
Builds a point feature from a dwg point .
17,209
public SimpleFeature convertDwgLine ( String typeName , String layerName , DwgLine line , int id ) { double [ ] p1 = line . getP1 ( ) ; double [ ] p2 = line . getP2 ( ) ; Point2D [ ] ptos = new Point2D [ ] { new Point2D . Double ( p1 [ 0 ] , p1 [ 1 ] ) , new Point2D . Double ( p2 [ 0 ] , p2 [ 1 ] ) } ; CoordinateList c...
Builds a line feature from a dwg line .
17,210
public SimpleFeature convertDwgCircle ( String typeName , String layerName , DwgCircle circle , int id ) { double [ ] center = circle . getCenter ( ) ; double radius = circle . getRadius ( ) ; Point2D [ ] ptos = GisModelCurveCalculator . calculateGisModelCircle ( new Point2D . Double ( center [ 0 ] , center [ 1 ] ) , r...
Builds a polygon feature from a dwg circle .
17,211
public SimpleFeature convertDwgSolid ( String typeName , String layerName , DwgSolid solid , int id ) { double [ ] p1 = solid . getCorner1 ( ) ; double [ ] p2 = solid . getCorner2 ( ) ; double [ ] p3 = solid . getCorner3 ( ) ; double [ ] p4 = solid . getCorner4 ( ) ; Point2D [ ] ptos = new Point2D [ ] { new Point2D . D...
Builds a polygon feature from a dwg solid .
17,212
public SimpleFeature convertDwgArc ( String typeName , String layerName , DwgArc arc , int id ) { double [ ] c = arc . getCenter ( ) ; Point2D center = new Point2D . Double ( c [ 0 ] , c [ 1 ] ) ; double radius = ( arc ) . getRadius ( ) ; double initAngle = Math . toDegrees ( ( arc ) . getInitAngle ( ) ) ; double endAn...
Builds a line feature from a dwg arc .
17,213
public static double norm_vec ( double x , double y , double z ) { return Math . sqrt ( x * x + y * y + z * z ) ; }
Normalized Vector .
17,214
public static double lag1 ( double [ ] vals ) { double mean = mean ( vals ) ; int size = vals . length ; double r1 ; double q = 0 ; double v = ( vals [ 0 ] - mean ) * ( vals [ 0 ] - mean ) ; for ( int i = 1 ; i < size ; i ++ ) { double delta0 = ( vals [ i - 1 ] - mean ) ; double delta1 = ( vals [ i ] - mean ) ; q += ( ...
Returns the lag - 1 autocorrelation of a dataset ;
17,215
public static double round ( double val , int places ) { long factor = ( long ) Math . pow ( 10 , places ) ; val = val * factor ; long tmp = Math . round ( val ) ; return ( double ) tmp / factor ; }
Round a double value to a specified number of decimal places .
17,216
public static double random ( double min , double max ) { assert max > min ; return min + Math . random ( ) * ( max - min ) ; }
Generate a random number in a range .
17,217
private boolean checkStructure ( ) { File ds ; ds = new File ( mapsetPath + File . separator + GrassLegacyConstans . CATS + File . separator ) ; if ( ! ds . exists ( ) ) if ( ! ds . mkdir ( ) ) return false ; ds = new File ( mapsetPath + File . separator + GrassLegacyConstans . CELL + File . separator ) ; if ( ! ds . e...
check if the needed folders are there ( they could be missing if the mapset has just been created and this is the first file that gets into it
17,218
private boolean createEmptyHeader ( String filePath , int rows ) { try { RandomAccessFile theCreatedFile = new RandomAccessFile ( filePath , "rw" ) ; rowaddresses = new long [ rows + 1 ] ; theCreatedFile . write ( 4 ) ; for ( int i = 0 ; i < rows + 1 ; i ++ ) { theCreatedFile . writeInt ( 0 ) ; } pointerInFilePosition ...
creates the space for the header of the rasterfile filling the spaces with zeroes . After the compression the values will be rewritten
17,219
private void createCellhd ( int chproj , int chzone , double chn , double chs , double che , double chw , int chcols , int chrows , double chnsres , double chewres , int chformat , int chcompressed ) throws Exception { StringBuffer data = new StringBuffer ( 512 ) ; data . append ( "proj: " + chproj + "\n" ) . append ...
changes the cellhd file inserting the new values obtained from the environment
17,220
public boolean compressAndWriteObj ( RandomAccessFile theCreatedFile , RandomAccessFile theCreatedNullFile , Object dataObject ) throws RasterWritingFailureException { if ( dataObject instanceof double [ ] [ ] ) { compressAndWrite ( theCreatedFile , theCreatedNullFile , ( double [ ] [ ] ) dataObject ) ; } else { throw ...
Passing the object after defining the type of data that will be written
17,221
public String getStyle ( StyleType type , Color color , String colorName , String layerName ) { throw new UnsupportedOperationException ( ) ; }
Generates a style from a template using the provided substitutions .
17,222
protected Reader toReader ( Object input ) throws IOException { if ( input instanceof Reader ) { return ( Reader ) input ; } if ( input instanceof InputStream ) { return new InputStreamReader ( ( InputStream ) input ) ; } if ( input instanceof String ) { return new StringReader ( ( String ) input ) ; } if ( input insta...
Turns input into a Reader .
17,223
public static boolean supportsNative ( ) { if ( ! testedLibLoading ) { LiblasJNALibrary wrapper = LiblasWrapper . getWrapper ( ) ; if ( wrapper != null ) { isNativeLibAvailable = true ; } testedLibLoading = true ; } return isNativeLibAvailable ; }
Checks of nativ libs are available .
17,224
public static ALasReader getReader ( File lasFile , CoordinateReferenceSystem crs ) throws Exception { if ( supportsNative ( ) ) { return new LiblasReader ( lasFile , crs ) ; } else { return new LasReaderBuffered ( lasFile , crs ) ; } }
Get a las reader .
17,225
public static ALasWriter getWriter ( File lasFile , CoordinateReferenceSystem crs ) throws Exception { if ( supportsNative ( ) ) { return new LiblasWriter ( lasFile , crs ) ; } else { return new LasWriterBuffered ( lasFile , crs ) ; } }
Get a las writer .
17,226
public void setRoot ( DbLevel v ) { DbLevel oldRoot = v ; root = v ; fireTreeStructureChanged ( oldRoot ) ; }
Sets the root to a given variable .
17,227
public void onError ( Exception e ) { e . printStackTrace ( ) ; String localizedMessage = e . getLocalizedMessage ( ) ; if ( localizedMessage == null ) { localizedMessage = e . getMessage ( ) ; } if ( localizedMessage == null || localizedMessage . trim ( ) . length ( ) == 0 ) { localizedMessage = "An undefined error wa...
Called if an error occurrs . Can be overridden . SHows dialog by default .
17,228
public static boolean tcaMax ( FlowNode flowNode , RandomIter tcaIter , RandomIter hacklengthIter , double maxTca , double maxDistance ) { List < FlowNode > enteringNodes = flowNode . getEnteringNodes ( ) ; for ( Node node : enteringNodes ) { double tca = node . getValueFromMap ( tcaIter ) ; if ( tca >= maxTca ) { if (...
Compare two value of tca and distance .
17,229
public static boolean isCircularBoundary ( CompoundLocation < Location > location , long sequenceLength ) { if ( location . getLocations ( ) . size ( ) == 1 ) { return false ; } boolean lastLocation = false ; List < Location > locationList = location . getLocations ( ) ; for ( int i = 0 ; i < locationList . size ( ) ; ...
Checks to see if a feature s location spans a circular boundary - assumes the genome the feature is coming from is circular .
17,230
public static boolean deleteDeletedValueQualifiers ( Feature feature , ArrayList < Qualifier > deleteQualifierList ) { boolean deleted = false ; for ( Qualifier qual : deleteQualifierList ) { feature . removeQualifier ( qual ) ; deleted = true ; } return deleted ; }
deletes the qualifiers which have DELETED value
17,231
public static boolean deleteDuplicatedQualfiier ( Feature feature , String qualifierName ) { ArrayList < Qualifier > qualifiers = ( ArrayList < Qualifier > ) feature . getQualifiers ( qualifierName ) ; Set < String > qualifierValueSet = new HashSet < String > ( ) ; for ( Qualifier qual : qualifiers ) { if ( qual . getV...
Delete duplicated qualfiier .
17,232
public ImageIcon getImage ( String key ) { ImageIcon image = imageMap . get ( key ) ; if ( image == null ) { image = createImage ( key ) ; imageMap . put ( key , image ) ; } return image ; }
Get an image for a certain key .
17,233
public static Style getStyleFromFile ( File file ) { Style style = null ; try { String name = file . getName ( ) ; if ( ! name . endsWith ( "sld" ) ) { String nameWithoutExtention = FileUtilities . getNameWithoutExtention ( file ) ; File sldFile = new File ( file . getParentFile ( ) , nameWithoutExtention + ".sld" ) ; ...
Get the style from an sld file .
17,234
private static void genericizeftStyles ( List < FeatureTypeStyle > ftStyles ) { for ( FeatureTypeStyle featureTypeStyle : ftStyles ) { featureTypeStyle . featureTypeNames ( ) . clear ( ) ; featureTypeStyle . featureTypeNames ( ) . add ( new NameImpl ( GENERIC_FEATURE_TYPENAME ) ) ; } }
Converts the type name of all FeatureTypeStyles to Feature so that the all apply to any feature type . This is admittedly dangerous but is extremely useful because it means that the style can be used with any feature type .
17,235
public static Color colorWithoutAlpha ( Color color ) { return new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) ) ; }
REmoves the alpha channel from a color .
17,236
public static Color colorWithAlpha ( Color color , int alpha ) { return new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) , alpha ) ; }
Creates a color with the given alpha .
17,237
public Map < String , TemplateTokenInfo > getTokensAsMap ( ) { HashMap < String , TemplateTokenInfo > tokens = new HashMap < String , TemplateTokenInfo > ( ) ; for ( TemplateTokenInfo tokenInfo : tokenInfos ) tokens . put ( tokenInfo . getName ( ) , tokenInfo ) ; return Collections . unmodifiableMap ( tokens ) ; }
returns a map keyed with the token name
17,238
public < T > T getTile4TileCoordinate ( final int tx , final int ty , int zoom , Class < T > adaptee ) throws IOException { Tile tile = new Tile ( tx , ty , ( byte ) zoom , tileSize ) ; RendererJob mapGeneratorJob = new RendererJob ( tile , mapDataStore , renderTheme , displayModel , scaleFactor , false , false ) ; Til...
Get tile data for a given tile schema coordinate .
17,239
public void ENopen ( String input , String report , String outputBin ) throws EpanetException { int errcode = epanet . ENopen ( input , report , outputBin ) ; checkError ( errcode ) ; }
Opens the Toolkit to analyze a particular distribution system .
17,240
public void ENsaveinpfile ( String fileName ) throws EpanetException { int err = epanet . ENsaveinpfile ( fileName ) ; checkError ( err ) ; }
Writes all current network input data to a file using the format of an EPANET input file .
17,241
public void ENsavehydfile ( String filePath ) throws EpanetException { int err = epanet . ENsavehydfile ( filePath ) ; checkError ( err ) ; }
Saves the current contents of the binary hydraulics file to a file .
17,242
public int ENgetcount ( Components countcode ) throws EpanetException { int [ ] count = new int [ 1 ] ; int error = epanet . ENgetcount ( countcode . getCode ( ) , count ) ; checkError ( error ) ; return count [ 0 ] ; }
Retrieves the number of network components of a specified type .
17,243
public float ENgetoption ( OptionParameterCodes optionCode ) throws EpanetException { float [ ] optionValue = new float [ 1 ] ; int error = epanet . ENgetoption ( optionCode . getCode ( ) , optionValue ) ; checkError ( error ) ; return optionValue [ 0 ] ; }
Retrieves the value of a particular analysis option .
17,244
public long ENgettimeparam ( TimeParameterCodes timeParameterCode ) throws EpanetException { long [ ] timeValue = new long [ 1 ] ; int error = epanet . ENgettimeparam ( timeParameterCode . getCode ( ) , timeValue ) ; checkError ( error ) ; return timeValue [ 0 ] ; }
Retrieves the value of a specific analysis time parameter .
17,245
public int ENgetpatternindex ( String id ) throws EpanetException { int [ ] index = new int [ 1 ] ; int error = epanet . ENgetpatternindex ( id , index ) ; checkError ( error ) ; return index [ 0 ] ; }
Retrieves the index of a particular time pattern .
17,246
public float ENgetpatternvalue ( int index , int period ) throws EpanetException { float [ ] value = new float [ 1 ] ; int errcode = epanet . ENgetpatternvalue ( index , period , value ) ; checkError ( errcode ) ; return value [ 0 ] ; }
Retrieves the multiplier factor for a specific time period in a time pattern .
17,247
public int ENgetnodeindex ( String id ) throws EpanetException { int [ ] index = new int [ 1 ] ; int error = epanet . ENgetnodeindex ( id , index ) ; checkError ( error ) ; return index [ 0 ] ; }
Retrieves the index of a node with a specified ID .
17,248
public NodeTypes ENgetnodetype ( int index ) throws EpanetException { int [ ] typecode = new int [ 1 ] ; int error = epanet . ENgetnodetype ( index , typecode ) ; checkError ( error ) ; NodeTypes type = NodeTypes . forCode ( typecode [ 0 ] ) ; return type ; }
Retrieves the node - type code for a specific node .
17,249
public int ENgetlinkindex ( String id ) throws EpanetException { int [ ] index = new int [ 1 ] ; int error = epanet . ENgetlinkindex ( id , index ) ; checkError ( error ) ; return index [ 0 ] ; }
Retrieves the index of a link with a specified ID .
17,250
public String ENgetlinkid ( int index ) throws EpanetException { ByteBuffer bb = ByteBuffer . allocate ( 64 ) ; int errcode = epanet . ENgetlinkid ( index , bb ) ; checkError ( errcode ) ; String label ; label = byteBuffer2String ( bb ) ; return label ; }
Retrieves the ID label of a link with a specified index .
17,251
public LinkTypes ENgetlinktype ( int index ) throws EpanetException { int [ ] typecode = new int [ 1 ] ; int error = epanet . ENgetlinktype ( index , typecode ) ; checkError ( error ) ; LinkTypes type = LinkTypes . forCode ( typecode [ 0 ] ) ; return type ; }
Retrieves the link - type code for a specific link .
17,252
public int [ ] ENgetlinknodes ( int index ) throws EpanetException { int [ ] from = new int [ 1 ] ; int [ ] to = new int [ 1 ] ; int error = epanet . ENgetlinknodes ( index , from , to ) ; checkError ( error ) ; return new int [ ] { from [ 0 ] , to [ 0 ] } ; }
Retrieves the indexes of the end nodes of a specified link .
17,253
public float [ ] ENgetlinkvalue ( int index , LinkParameters param ) throws EpanetException { float [ ] value = new float [ 2 ] ; int errcode = epanet . ENgetlinkvalue ( index , param . getCode ( ) , value ) ; checkError ( errcode ) ; return value ; }
Retrieves the value of a specific link parameter .
17,254
public int ENgetversion ( ) throws EpanetException { int [ ] version = new int [ 0 ] ; int errcode = epanet . ENgetversion ( version ) ; checkError ( errcode ) ; return version [ 0 ] ; }
Get the version of OmsEpanet .
17,255
public void ENsetnodevalue ( int index , NodeParameters nodeParameter , float value ) throws EpanetException { int errcode = epanet . ENsetnodevalue ( index , nodeParameter . getCode ( ) , value ) ; checkError ( errcode ) ; }
Sets the value of a parameter for a specific node .
17,256
public void ENsetlinkvalue ( int index , LinkParameters linkParameter , float value ) throws EpanetException { int errcode = epanet . ENsetnodevalue ( index , linkParameter . getCode ( ) , value ) ; checkError ( errcode ) ; }
Sets the value of a parameter for a specific link .
17,257
public void ENaddpattern ( String id ) throws EpanetException { int errcode = epanet . ENaddpattern ( id ) ; checkError ( errcode ) ; }
Adds a new time pattern to the network .
17,258
public void ENsettimeparam ( TimeParameterCodes code , Long timevalue ) throws EpanetException { int errcode = epanet . ENsettimeparam ( code . getCode ( ) , timevalue ) ; checkError ( errcode ) ; }
Sets the value of a time parameter .
17,259
public void ENsetoption ( OptionParameterCodes optionCode , float value ) throws EpanetException { int errcode = epanet . ENsetoption ( optionCode . getCode ( ) , value ) ; checkError ( errcode ) ; }
Sets the value of a particular analysis option .
17,260
public static ValidationException error ( String messageKey , Object ... params ) { return new ValidationException ( ValidationMessage . error ( messageKey , params ) ) ; }
Creates a ValidationException which contains a ValidationMessage error .
17,261
public static ValidationException warning ( String messageKey , Object ... params ) { return new ValidationException ( ValidationMessage . warning ( messageKey , params ) ) ; }
Creates a ValidationException which contains a ValidationMessage warning .
17,262
public static ValidationException info ( String messageKey , Object ... params ) { return new ValidationException ( ValidationMessage . info ( messageKey , params ) ) ; }
Creates a ValidationException which contains a ValidationMessage info .
17,263
protected void writeFeatureLocation ( Writer writer ) throws IOException { new FeatureLocationWriter ( entry , feature , wrapType , featureHeader , qualifierHeader ) . write ( writer ) ; }
overridden in HTMLFeatureWriter
17,264
public void beginElement ( String elementName ) throws IOException { addElementName ( elementName ) ; indent ( ) ; writer . write ( "<" ) ; writer . write ( elementName ) ; }
Writes <elementName .
17,265
public void openElement ( String elementName ) throws IOException { assert ( elementNames . size ( ) > 0 ) ; assert ( elementNames . get ( elementNames . size ( ) - 1 ) . equals ( elementName ) ) ; writer . write ( ">" ) ; if ( indent || noTextElement ) { writer . write ( "\n" ) ; } }
Writes > \ n .
17,266
public void setData ( FieldContent data ) { if ( this . data != null ) { throw new ComponentException ( "Attempt to set @In field twice: " + comp + "." + field . getName ( ) ) ; } this . data = data ; }
called in in access
17,267
double qobs ( int dummy , double [ ] xt ) { int x = ( int ) ( xt [ 0 ] ) ; double p = Math . random ( ) ; double [ ] distr = accumP [ x ] ; int i , left = 0 , right = distr . length - 1 ; while ( left <= right ) { i = ( left + right ) / 2 ; if ( p < distr [ i ] ) { right = i - 1 ; } else if ( distr [ i ] < p ) { left =...
An efficient version of qobs using binary search in accumP
17,268
public static byte [ ] hexToBytes ( String hex ) { int byteLen = hex . length ( ) / 2 ; byte [ ] bytes = new byte [ byteLen ] ; for ( int i = 0 ; i < hex . length ( ) / 2 ; i ++ ) { int i2 = 2 * i ; if ( i2 + 1 > hex . length ( ) ) throw new IllegalArgumentException ( "Hex string has odd length" ) ; int nib1 = hexToInt...
Converts a hexadecimal string to a byte array . The hexadecimal digit symbols are case - insensitive .
17,269
private Geometry setSRID ( Geometry g , int SRID ) { if ( SRID != 0 ) g . setSRID ( SRID ) ; return g ; }
Sets the SRID if it was specified in the WKB
17,270
private void readCoordinate ( ) throws IOException { for ( int i = 0 ; i < inputDimension ; i ++ ) { if ( i <= 1 ) { ordValues [ i ] = precisionModel . makePrecise ( dis . readDouble ( ) ) ; } else { ordValues [ i ] = dis . readDouble ( ) ; } } }
Reads a coordinate value with the specified dimensionality . Makes the X and Y ordinates precise according to the precision model in use .
17,271
public static void connectElements ( List < IHillSlope > elements ) { Collections . sort ( elements , elements . get ( 0 ) ) ; for ( int i = 0 ; i < elements . size ( ) ; i ++ ) { IHillSlope elem = elements . get ( i ) ; for ( int j = i + 1 ; j < elements . size ( ) ; j ++ ) { IHillSlope tmp = elements . get ( j ) ; el...
Connect the various elements in a chain of tributary basins and nets
17,272
public static final String bytesToHex ( byte [ ] bs , int off , int length ) { StringBuffer sb = new StringBuffer ( length * 2 ) ; bytesToHexAppend ( bs , off , length , sb ) ; return sb . toString ( ) ; }
Converts a byte array into a string of upper case hex chars .
17,273
public Vector getPoints ( double inc ) { Vector arc = new Vector ( ) ; double angulo ; int iempieza = ( int ) empieza + 1 ; int iacaba = ( int ) acaba ; if ( empieza <= acaba ) { addNode ( arc , empieza ) ; for ( angulo = iempieza ; angulo <= iacaba ; angulo += inc ) { addNode ( arc , angulo ) ; } addNode ( arc , acaba...
This method calculates an arc in a Gis geometry model . This arc is represented in this model by a Vector of Point2D . The distance between points in the arc is given as an argument
17,274
public Vector getCentralPoint ( ) { Vector arc = new Vector ( ) ; if ( empieza <= acaba ) { addNode ( arc , ( empieza + acaba ) / 2.0 ) ; } else { addNode ( arc , empieza ) ; double alfa = 360 - empieza ; double beta = acaba ; double an = alfa + beta ; double mid = an / 2.0 ; if ( mid <= alfa ) { addNode ( arc , empiez...
Method that allows to obtain a set of points located in the central zone of this arc object
17,275
public static List < FileStoreDataSet > getDataSets ( File cacheRoot ) { if ( cacheRoot == null ) { String message = Logging . getMessage ( "nullValue.FileStorePathIsNull" ) ; Logging . logger ( ) . severe ( message ) ; throw new IllegalArgumentException ( message ) ; } ArrayList < FileStoreDataSet > datasets = new Arr...
Find all of the data set directories in a cache root .
17,276
protected static File [ ] listDirs ( File parent ) { return parent . listFiles ( new FileFilter ( ) { public boolean accept ( File file ) { return file . isDirectory ( ) ; } } ) ; }
List all of the sub - directories in a parent directory .
17,277
protected static boolean isNumeric ( String s ) { for ( char c : s . toCharArray ( ) ) { if ( ! Character . isDigit ( c ) ) return false ; } return true ; }
Determines if a string contains only digits .
17,278
public static void createModulesOverview ( ) { Map < String , List < ClassField > > hmModules = HortonMachine . getInstance ( ) . moduleName2Fields ; Map < String , List < ClassField > > jggModules = JGrassGears . getInstance ( ) . moduleName2Fields ; Map < String , Class < ? > > hmModulesClasses = HortonMachine . getI...
Creates an overview of all the OMS modules for the wiki site .
17,279
public static Server startTcpServerMode ( String port , boolean doSSL , String tcpPassword , boolean ifExists , String baseDir ) throws SQLException { List < String > params = new ArrayList < > ( ) ; params . add ( "-tcpAllowOthers" ) ; params . add ( "-tcpPort" ) ; if ( port == null ) { port = "9123" ; } params . add ...
Start the server mode .
17,280
public static Server startWebServerMode ( String port , boolean doSSL , boolean ifExists , String baseDir ) throws SQLException { List < String > params = new ArrayList < > ( ) ; params . add ( "-webAllowOthers" ) ; if ( port != null ) { params . add ( "-webPort" ) ; params . add ( port ) ; } if ( doSSL ) { params . ad...
Start the web server mode .
17,281
public static String createTableFromShp ( ASpatialDb db , File shapeFile , String newTableName , boolean avoidSpatialIndex ) throws Exception { FileDataStore store = FileDataStoreFinder . getDataStore ( shapeFile ) ; SimpleFeatureSource featureSource = store . getFeatureSource ( ) ; SimpleFeatureType schema = featureSo...
Create a spatial table using a shapefile as schema .
17,282
public static boolean importShapefile ( ASpatialDb db , File shapeFile , String tableName , int limit , IHMProgressMonitor pm ) throws Exception { FileDataStore store = FileDataStoreFinder . getDataStore ( shapeFile ) ; SimpleFeatureSource featureSource = store . getFeatureSource ( ) ; SimpleFeatureCollection features ...
Import a shapefile into a table .
17,283
private void writeExif ( ) throws IOException { IIOMetadata metadata = jpegReader . getImageMetadata ( 0 ) ; String [ ] names = metadata . getMetadataFormatNames ( ) ; IIOMetadataNode root = ( IIOMetadataNode ) metadata . getAsTree ( names [ 0 ] ) ; NodeList nList = root . getElementsByTagName ( "unknown" ) ; IIOMetada...
Main method to write the gps data to the exif
17,284
private ArrayList < IIOMetadata > readExif ( IIOMetadataNode app1EXIFNode ) { byte [ ] app1Params = ( byte [ ] ) app1EXIFNode . getUserObject ( ) ; MemoryCacheImageInputStream app1EXIFInput = new MemoryCacheImageInputStream ( new ByteArrayInputStream ( app1Params , 6 , app1Params . length - 6 ) ) ; ImageReader tiffRead...
Private method - Reads the exif metadata for an image
17,285
private IIOMetadataNode createNewExifNode ( IIOMetadata tiffMetadata , IIOMetadata thumbMeta , BufferedImage thumbnail ) { IIOMetadataNode app1Node = null ; ImageWriter tiffWriter = null ; try { Iterator < ImageWriter > writers = ImageIO . getImageWritersByFormatName ( "tiff" ) ; while ( writers . hasNext ( ) ) { tiffW...
Private method - creates a copy of the metadata that can be written to
17,286
private long [ ] [ ] getLatitude ( String lat ) { float secs = Float . parseFloat ( "0" + lat . substring ( 4 ) ) * 60.f ; long nom = ( long ) ( secs * 1000 ) ; long [ ] [ ] latl = new long [ ] [ ] { { Long . parseLong ( lat . substring ( 0 , 2 ) ) , 1 } , { Long . parseLong ( lat . substring ( 2 , 4 ) ) , 1 } , { nom ...
assumes the the format is HHMM . MMMM
17,287
private long [ ] [ ] getLongitude ( String longi ) { float secs = Float . parseFloat ( "0" + longi . substring ( 5 ) ) * 60.f ; long nom = ( long ) ( secs * 1000 ) ; long [ ] [ ] longl = new long [ ] [ ] { { Long . parseLong ( longi . substring ( 0 , 3 ) ) , 1 } , { Long . parseLong ( longi . substring ( 3 , 5 ) ) , 1 ...
assumes the the format is HHHMM . MMMM
17,288
private long [ ] [ ] getTime ( String time ) { long [ ] [ ] timel = new long [ ] [ ] { { Long . parseLong ( time . substring ( 0 , 2 ) ) , 1 } , { Long . parseLong ( time . substring ( 2 , 4 ) ) , 1 } , { Long . parseLong ( time . substring ( 4 ) ) , 1 } } ; return timel ; }
Convert a time to exif format .
17,289
private String [ ] getDate ( String date ) { String dateStr = "20" + date . substring ( 4 ) + ":" + date . substring ( 2 , 4 ) + ":" + date . substring ( 0 , 2 ) ; String [ ] dateArray = new String [ 11 ] ; for ( int i = 0 ; i < dateStr . length ( ) ; i ++ ) dateArray [ i ] = dateStr . substring ( i , i + 1 ) ; dateArr...
Convert a date to exif date .
17,290
void clear ( ) { count = 0 ; m0 = 0.0 ; clusters . space . setToOrigin ( m1 ) ; clusters . space . setToOrigin ( m2 ) ; var = 0.0 ; key = null ; }
Completely clears this cluster . All points and their associated mass is removed along with any key that was assigned to the cluster
17,291
void set ( final double m , final Object pt ) { if ( m == 0.0 ) { if ( count != 0 ) { clusters . space . setToOrigin ( m1 ) ; clusters . space . setToOrigin ( m2 ) ; } } else { clusters . space . setToScaled ( m1 , m , pt ) ; clusters . space . setToScaledSqr ( m2 , m , pt ) ; } count = 1 ; m0 = m ; var = 0.0 ; }
Sets this cluster equal to a single point .
17,292
void add ( final double m , final Object pt ) { if ( count == 0 ) { set ( m , pt ) ; } else { count += 1 ; if ( m != 0.0 ) { m0 += m ; clusters . space . addScaled ( m1 , m , pt ) ; clusters . space . addScaledSqr ( m2 , m , pt ) ; update ( ) ; } } }
Adds a point to the cluster .
17,293
void set ( GvmCluster < S , K > cluster ) { if ( cluster == this ) throw new IllegalArgumentException ( "cannot set cluster to itself" ) ; m0 = cluster . m0 ; clusters . space . setTo ( m1 , cluster . m1 ) ; clusters . space . setTo ( m2 , cluster . m2 ) ; var = cluster . var ; }
Sets this cluster equal to the specified cluster
17,294
void add ( GvmCluster < S , K > cluster ) { if ( cluster == this ) throw new IllegalArgumentException ( ) ; if ( cluster . count == 0 ) return ; if ( count == 0 ) { set ( cluster ) ; } else { count += cluster . count ; m0 += cluster . m0 ; clusters . space . add ( m1 , cluster . m1 ) ; clusters . space . add ( m2 , clu...
Adds the specified cluster to this cluster .
17,295
public static synchronized String char2DOS437 ( StringBuffer stringbuffer , int i , char c ) { if ( unicode2DOS437 == null ) { unicode2DOS437 = new char [ 0x10000 ] ; for ( int j = 0 ; j < 256 ; j ++ ) { char c1 ; if ( ( c1 = unicode [ 2 ] [ j ] ) != '\uFFFF' ) unicode2DOS437 [ c1 ] = ( char ) j ; } } if ( i != 2 ) { S...
Char to DOS437 converter
17,296
public static void callAnnotated ( Object o , Class < ? extends Annotation > ann , boolean lazy ) { try { getMethodOfInterest ( o , ann ) . invoke ( o ) ; } catch ( IllegalAccessException ex ) { throw new RuntimeException ( ex ) ; } catch ( InvocationTargetException ex ) { throw new RuntimeException ( ex . getCause ( )...
Call an method by Annotation .
17,297
public static Class infoClass ( Class cmp ) { Class info = null ; try { info = Class . forName ( cmp . getName ( ) + "CompInfo" ) ; } catch ( ClassNotFoundException E ) { info = cmp ; } return info ; }
Get the info class for a component object
17,298
public static boolean adjustOutputPath ( File outputDir , Object comp , Logger log ) { boolean adjusted = false ; ComponentAccess cp = new ComponentAccess ( comp ) ; for ( Access in : cp . inputs ( ) ) { String fieldName = in . getField ( ) . getName ( ) ; Class fieldType = in . getField ( ) . getType ( ) ; if ( fieldT...
Adjust the output path .
17,299
public static Properties createDefault ( Object comp ) { Properties p = new Properties ( ) ; ComponentAccess ca = new ComponentAccess ( comp ) ; for ( Access in : ca . inputs ( ) ) { try { String name = in . getField ( ) . getName ( ) ; Object o = in . getField ( ) . get ( comp ) ; if ( o != null ) { String value = o ....
Create a default parameter set