Package org.apache.sis.measure

Examples of org.apache.sis.measure.Longitude


        this.eastBoundLongitude = eastBoundLongitude;
        this.southBoundLatitude = southBoundLatitude;
        this.northBoundLatitude = northBoundLatitude;
        final Angle min, max;
        if (westBoundLongitude > eastBoundLongitude) {
            min = new Longitude(westBoundLongitude);
            max = new Longitude(eastBoundLongitude);
        } else if (southBoundLatitude > northBoundLatitude) {
            min = new Latitude(southBoundLatitude);
            max = new Latitude(northBoundLatitude);
        } else {
            return;
View Full Code Here


            throws IllegalArgumentException
    {
        checkWritePermission();
        final Angle min, max;
        if (westBoundLongitude > eastBoundLongitude) {
            min = new Longitude(westBoundLongitude);
            max = new Longitude(eastBoundLongitude);
            // Exception will be thrown below.
        } else if (southBoundLatitude > northBoundLatitude) {
            min = new Latitude(southBoundLatitude);
            max = new Latitude(northBoundLatitude);
            // Exception will be thrown below.
View Full Code Here

    @Override
    Object get(final int index, final Object metadata) throws BackingStoreException {
        Object value = super.get(index, metadata);
        if (value != null) {
            if (index == westBoundLongitude || index == eastBoundLongitude) {
                value = new Longitude((Double) value);
            } else if (index == southBoundLatitude || index == northBoundLatitude) {
                value = new Latitude((Double) value);
            }
        }
        return value;
View Full Code Here

            if (value instanceof Longitude) {
                value = ((Longitude) value).degrees();
            }
            value = super.set(index, metadata, value, mode);
            if (value != null) {
                value = new Longitude((Double) value);
            }
            return value;
        } else if ((index == southBoundLatitude || index == northBoundLatitude)) {
            if (value instanceof Latitude) {
                value = ((Latitude) value).degrees();
View Full Code Here

     * Tests {@link SpecialCases#get(int, Object)}.
     */
    @Test
    public void testGet() {
        createBox();
        assertPropertyEquals("westBoundLongitude", new Longitude(-20));
        assertPropertyEquals("eastBoundLongitude", new Longitude( 30));
        assertPropertyEquals("southBoundLatitude", new Latitude (-10));
        assertPropertyEquals("northBoundLatitude", new Latitude ( 40));
        assertPropertyEquals("extentTypeCode",     Boolean.TRUE      );
    }
View Full Code Here

     */
    @Test
    @DependsOnMethod("testGet")
    public void testSet() {
        createBox();
        assertPreviousEquals("westBoundLongitude", new Longitude(-20), new Longitude(-15));
        assertPreviousEquals("eastBoundLongitude", new Longitude( 30), new Longitude( 25));
        assertPreviousEquals("southBoundLatitude", new Latitude (-10), new Latitude ( -5));
        assertPreviousEquals("northBoundLatitude", new Latitude ( 40), new Latitude ( 35));
        assertPreviousEquals("extentTypeCode",     Boolean.TRUE,       Boolean.FALSE);

        assertEquals("westBoundLongitude", -15, box.getWestBoundLongitude(), STRICT);
View Full Code Here

     */
    @Test
    @DependsOnMethod("testSet")
    public void testSetAsPrimitive() {
        createBox();
        assertPreviousEquals("westBoundLongitude", new Longitude(-20), -14.0);
        assertPreviousEquals("eastBoundLongitude", new Longitude( 30)26  );
        assertPreviousEquals("southBoundLatitude", new Latitude (-10),  -7f );
        assertPreviousEquals("northBoundLatitude", new Latitude ( 40), (short) 33);

        assertEquals("westBoundLongitude", -14, box.getWestBoundLongitude(), STRICT);
        assertEquals("eastBoundLongitude"26, box.getEastBoundLongitude(), STRICT);
View Full Code Here

     */
    @Test
    @DependsOnMethod("testSet")
    public void testAppend() {
        createBox();
        assertAppendResultEquals("westBoundLongitude", null, new Longitude(-20));
        assertAppendResultEquals("eastBoundLongitude", null, new Longitude( 24));
        assertAppendResultEquals("southBoundLatitude", null, new Latitude ( -6));
        assertAppendResultEquals("northBoundLatitude", null, 40.0);
        assertAppendResultEquals("extentTypeCode", false, Boolean.TRUE);

        assertEquals("westBoundLongitude", -20, box.getWestBoundLongitude(), STRICT);
View Full Code Here

TOP

Related Classes of org.apache.sis.measure.Longitude

Copyright © 2018 www.massapicom. 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.