Package org.openstreetmap.josm.io

Examples of org.openstreetmap.josm.io.OsmApi$CapabilitiesCache


public class ApiPreconditionCheckerHook implements UploadHook {

    @Override
    public boolean checkUpload(APIDataSet apiData) {
        OsmApi api = OsmApi.getOsmApi();
        try {
            // FIXME: this should run asynchronously and a progress monitor
            // should be displayed.
            api.initialize(NullProgressMonitor.INSTANCE);
            long maxNodes = 0;
            if (api.getCapabilities().isDefined("waynodes", "maximum")) {
                maxNodes = api.getCapabilities().getLong("waynodes","maximum");
            }
            if (maxNodes > 0) {
                if( !checkMaxNodes(apiData.getPrimitivesToAdd(), maxNodes))
                    return false;
                if( !checkMaxNodes(apiData.getPrimitivesToUpdate(), maxNodes))
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.io.OsmApi$CapabilitiesCache

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.