Rev

Rev 1822 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | Bug Tracker

Rev 1822 Rev 2655
Line 2... Line 2...
2
 * @author      ETSI / STF481 / Yann Garcia
2
 * @author      ETSI / STF481 / Yann Garcia
3
 * @version     $URL: file:///D:/RepositoriesNew/ITS/trunk/javasrc/geodesic/org/etsi/geodesic/CountriesAreas.java $
3
 * @version     $URL: file:///D:/RepositoriesNew/ITS/trunk/javasrc/geodesic/org/etsi/geodesic/CountriesAreas.java $
4
 *              $Id: CountriesAreas.java 1789 2014-11-04 13:09:48Z garciay $
4
 *              $Id: CountriesAreas.java 2655 2017-01-26 10:46:08Z filatov $
5
 */
5
 */
6
package org.etsi.geodesic;
6
package org.etsi.geodesic;
7
7
8
import java.io.BufferedReader;
8
import java.io.BufferedReader;
9
import java.io.File;
9
import java.io.File;
Line 13... Line 13...
13
import java.lang.management.ManagementFactory;
13
import java.lang.management.ManagementFactory;
14
import java.lang.management.RuntimeMXBean;
14
import java.lang.management.RuntimeMXBean;
15
import java.util.ArrayList;
15
import java.util.ArrayList;
16
import java.util.HashMap;
16
import java.util.HashMap;
17
import java.util.Map;
17
import java.util.Map;
-
 
18
-
 
19
import org.etsi.adapter.TERFactory;
18
20
19
import com.google.gson.JsonArray;
21
import com.google.gson.JsonArray;
20
import com.google.gson.JsonElement;
22
import com.google.gson.JsonElement;
21
import com.google.gson.JsonObject;
23
import com.google.gson.JsonObject;
22
import com.google.gson.JsonParser;
24
import com.google.gson.JsonParser;
Line 430... Line 432...
430
        }
432
        }
431
    }
433
    }
432
   
434
   
433
    @Override
435
    @Override
434
    public boolean isLocationInsideIdentifiedRegion(final int p_regionDictionary, final int p_regionId, final long p_localRegion, final WGS84 p_location) {
436
    public boolean isLocationInsideIdentifiedRegion(final int p_regionDictionary, final int p_regionId, final long p_localRegion, final WGS84 p_location) {
435
//        System.out.println(">>> CountriesAreas.isLocationInsideIdentifiedRegion: " + p_regionDictionary + ", " + p_regionId + ", " + p_localRegion + ", " + p_location);
437
//        TERFactory.getInstance().logDebug(">>> CountriesAreas.isLocationInsideIdentifiedRegion: " + p_regionDictionary + ", " + p_regionId + ", " + p_localRegion + ", " + p_location);
436
       
438
       
437
        boolean result = false;
439
        boolean result = false;
438
        if (p_regionDictionary == Iso_3166_1) {
440
        if (p_regionDictionary == Iso_3166_1) {
439
            if (_in2str4iso3611.containsKey(p_regionId)) {
441
            if (_in2str4iso3611.containsKey(p_regionId)) {
440
                result = process(_in2str4iso3611.get(p_regionId), p_localRegion, p_location);
442
                result = process(_in2str4iso3611.get(p_regionId), p_localRegion, p_location);
Line 447... Line 449...
447
       
449
       
448
        return result;
450
        return result;
449
    }
451
    }
450
   
452
   
451
    public boolean process(final String p_regionId, final long p_localRegion, final WGS84 p_location) {
453
    public boolean process(final String p_regionId, final long p_localRegion, final WGS84 p_location) {
452
//        System.out.println(">>> CountriesAreas.process: " + p_regionId + ", " + p_localRegion + ", " + p_location);
454
//        TERFactory.getInstance().logDebug(">>> CountriesAreas.process: " + p_regionId + ", " + p_localRegion + ", " + p_location);
453
       
455
       
454
        if (_countriesPolygons.containsKey(p_regionId)) {
456
        if (_countriesPolygons.containsKey(p_regionId)) {
455
            ArrayList<ArrayList<WGS84>> areas = _countriesPolygons.get(p_regionId);
457
            ArrayList<ArrayList<WGS84>> areas = _countriesPolygons.get(p_regionId);
456
            return Positioning.getInstance().isLocationInsidePolygonalAreas(p_location, areas);
458
            return Positioning.getInstance().isLocationInsidePolygonalAreas(p_location, areas);
457
        }
459
        }