Examples of asText()


Examples of com.esri.core.geometry.ogc.OGCGeometry.asText()

  public void testGeometryCollectionBuffer() {
    OGCGeometry g = OGCGeometry
        .fromText("GEOMETRYCOLLECTION(POINT(1 1), POINT(1 1), POINT(1 2), LINESTRING (0 0, 1 1, 1 0, 0 1), MULTIPOLYGON EMPTY, MULTILINESTRING EMPTY)");
    OGCGeometry simpleG = g.buffer(0);
    String t = simpleG.geometryType();
    String rt = simpleG.asText();
    assertTrue(simpleG.geometryType().equals("GeometryCollection"));
  }

  @Test
  public void testIsectTria1() {
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCMultiCurve.asText()

    b = lsi.equals(OGCGeometry
        .fromText("LINESTRING(-5 -5, -5 5, 5 5, 5 -5, -5 -5)"));
    assertTrue(b);
    assertTrue(!lsi.equals(ls));
    OGCMultiCurve boundary = p.boundary();
    String s = boundary.asText();
    assertTrue(s.equals("MULTILINESTRING ((-10 -10, 10 -10, 10 10, -10 10, -10 -10), (-5 -5, -5 5, 5 5, 5 -5, -5 -5))"));
  }

  @Test
  public void testGeometryCollection() throws JSONException {
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.JsonNode.asText()

            return String.valueOf(currentNode().numberValue());
        case VALUE_EMBEDDED_OBJECT:
            JsonNode n = currentNode();
            if (n != null && n.isBinary()) {
                // this will convert it to base64
                return n.asText();
            }
        }

        return (_currToken == null) ? null : _currToken.asString();
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.asText()

                }
            }
            if(!either_locationId_or_coord) throw new IllegalStateException("location missing. either locationId or locationCoordinate is required");
            //service name
            JsonNode nameNode = serviceNode.path(JsonConstants.Job.NAME);
            if(!nameNode.isMissingNode()) serviceBuilder.setName(nameNode.asText());
            //service duration
            serviceBuilder.setServiceTime(serviceNode.path(JsonConstants.Job.SERVICE_DURATION).asDouble());
            //service tw
            JsonNode start_tw_node = serviceNode.path(JsonConstants.Job.TIME_WINDOW).path(JsonConstants.TimeWindow.START);
            JsonNode end_tw_node = serviceNode.path(JsonConstants.Job.TIME_WINDOW).path(JsonConstants.TimeWindow.END);
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.asText()

        JsonNode vehicles = root.path(JsonConstants.VEHICLES);
        for(JsonNode vehicleNode : vehicles){
            //vehicle id
            JsonNode vehicle_id_node = vehicleNode.path(JsonConstants.Vehicle.ID);
            if(vehicle_id_node.isMissingNode()) throw new IllegalStateException("vehicle id missing");
            VehicleImpl.Builder vehicleBuilder = VehicleImpl.Builder.newInstance(vehicle_id_node.asText());
            //vehicle type
            VehicleType type = vehicle_type_map.get(vehicleNode.path(JsonConstants.Vehicle.TYPE_ID).asText());
            vehicleBuilder.setType(type);
            //earliest start
            JsonNode earliestStartNode = vehicleNode.path(JsonConstants.Vehicle.EARLIEST_START);
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.asText()

            //start
                //location id
            boolean either_id_or_coord = false;
            JsonNode startAddressId = vehicleNode.path(JsonConstants.Vehicle.START_ADDRESS).path(JsonConstants.Address.ID);
            if(!startAddressId.isMissingNode()){
                vehicleBuilder.setStartLocationId(startAddressId.asText());
                either_id_or_coord = true;
            }
                //location coordinate
            {
                JsonNode lonNode = vehicleNode.path(JsonConstants.Vehicle.START_ADDRESS).path(JsonConstants.Address.LON);
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.asText()

            if(!either_id_or_coord) throw new IllegalStateException("start location of vehicle missing. either id or coordinate required");
            //end
                //location id
            JsonNode endAddressId = vehicleNode.path(JsonConstants.Vehicle.END_ADDRESS).path(JsonConstants.Address.ID);
            if(!endAddressId.isMissingNode()){
                if(!startAddressId.asText().equals(endAddressId.asText())){
                    vehicleBuilder.setEndLocationId(endAddressId.asText());
                }
            }
                //location coordinate
            {
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.asText()

            //end
                //location id
            JsonNode endAddressId = vehicleNode.path(JsonConstants.Vehicle.END_ADDRESS).path(JsonConstants.Address.ID);
            if(!endAddressId.isMissingNode()){
                if(!startAddressId.asText().equals(endAddressId.asText())){
                    vehicleBuilder.setEndLocationId(endAddressId.asText());
                }
            }
                //location coordinate
            {
                JsonNode lonNode = vehicleNode.path(JsonConstants.Vehicle.END_ADDRESS).path(JsonConstants.Address.LON);
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.asText()

    private void parse_and_map_vehicle_types(JsonNode root) {
        JsonNode types = root.path(JsonConstants.VEHICLE_TYPES);
        for(JsonNode typeNode : types){
            JsonNode typeIdNode = typeNode.path(JsonConstants.Vehicle.Type.ID);
            if(typeIdNode.isMissingNode()) throw new IllegalStateException("type id missing");
            VehicleTypeImpl.Builder typeBuilder = VehicleTypeImpl.Builder.newInstance(typeIdNode.asText());
            typeBuilder.setFixedCost(typeNode.path(JsonConstants.Vehicle.Type.FIXED_COSTS).asDouble());
            typeBuilder.setCostPerDistance(typeNode.path(JsonConstants.Vehicle.Type.DISTANCE).asDouble());
            typeBuilder.setCostPerTime(typeNode.path(JsonConstants.Vehicle.Type.TIME).asDouble());
            JsonNode capacity = typeNode.path(JsonConstants.Vehicle.Type.CAPACITY);
            Iterator<JsonNode> capacity_dimension_iterator = capacity.iterator();
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.asText()

            //service id
            JsonNode jobIdNode = serviceNode.path(JsonConstants.Job.ID);
            if(jobIdNode.isMissingNode()) throw new IllegalStateException("service-id is missing");

            Service.Builder serviceBuilder;
            if(typeNode.isMissingNode()) serviceBuilder = Service.Builder.newInstance(jobIdNode.asText());
            else if(typeNode.asText().equals(JsonConstants.Job.SERVICE)) serviceBuilder = Service.Builder.newInstance(jobIdNode.asText());
            else if(typeNode.asText().equals(JsonConstants.Job.PICKUP)) serviceBuilder = Pickup.Builder.newInstance(jobIdNode.asText());
            else if(typeNode.asText().equals(JsonConstants.Job.DELIVERY)) serviceBuilder = Delivery.Builder.newInstance(jobIdNode.asText());
            else throw new IllegalStateException("type of service ("+typeNode.asText()+") is not supported");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.