@Nullable
    private static Point getCachePoint(final Geocache cache, final boolean withWaypoints, final boolean withCacheDetails) {
        if (cache == null || cache.getCoords() == null) {
            return null;
        }

        // create one simple point with location
        final Location loc = new Location();
        loc.setProvider("cgeo");
        loc.setLatitude(cache.getCoords().getLatitude());
        loc.setLongitude(cache.getCoords().getLongitude());

        final Point wpt = new Point(cache.getName(), loc);
        // generate new data
        final GeocachingData gcData = new GeocachingData();

        // fill data with variables
        gcData.setCacheID(cache.getGeocode());
        gcData.setName(cache.getName());

        // rest is optional so fill as you want - should work
        gcData.setOwner(cache.getOwnerUserId());
        gcData.setPlacedBy(cache.getOwnerDisplayName());
        if (cache.getDifficulty() > 0) {
            gcData.setDifficulty(cache.getDifficulty());
        }
        if (cache.getTerrain() > 0) {
            gcData.setTerrain(cache.getTerrain());
        }
        gcData.setContainer(toLocusSize(cache.getSize()));
        final ArrayList<GeocachingAttribute> attributes = toLocusAttributes(cache.getAttributes());
        if (!attributes.isEmpty()) {
            gcData.setAttributes(attributes);
        }

        gcData.setAvailable(!cache.isDisabled());
        gcData.setArchived(cache.isArchived());
        gcData.setPremiumOnly(cache.isPremiumMembersOnly());
        final Date hiddenDate = cache.getHiddenDate();
        if (hiddenDate != null) {
            gcData.setDateHidden(hiddenDate.getTime());
        }
        gcData.setType(toLocusType(cache.getType()));
        gcData.setFound(cache.isFound());

        if (withWaypoints && cache.hasWaypoints()) {
            for (final cgeo.geocaching.models.Waypoint waypoint : cache.getWaypoints()) {
                if (waypoint == null) {
                    continue;
                }

                final GeocachingWaypoint gcWpt = new GeocachingWaypoint();
                gcWpt.setCode(waypoint.getLookup());
                gcWpt.setName(waypoint.getName());
                gcWpt.setDesc(waypoint.getNote());
                gcWpt.setType(toLocusWaypoint(waypoint.getWaypointType()));

                final Geopoint waypointCoords = waypoint.getCoords();
                if (waypointCoords != null) {
                    gcWpt.setLon(waypointCoords.getLongitude());
                    gcWpt.setLat(waypointCoords.getLatitude());
                }

                gcData.getWaypoints().add(gcWpt);
            }
        }

        // Other properties of caches. When there are many caches to be displayed
        // in Locus, using these properties can lead to Exceptions in Locus.
        // Should not be used if caches count > 200
        if (withCacheDetails) {
            gcData.setDescriptions(
                    cache.getShortDescription(), true,
                    cache.getDescription(), true);
            gcData.setEncodedHints(cache.getHint());
        }

        // set data and return point
        wpt.setGcData(gcData);
        return wpt;
    }
This method constructs a {@code Point} for displaying in Locus

@param withWaypoints    whether to give waypoints to Locus or not
@param withCacheDetails whether to give cache details (description, hint) to Locus or not
                        should be false for all if more than 200 Caches are transferred
@return null, when the {@code Point} could not be constructed
main/src/main/java/cgeo/geocaching/apps/AbstractLocusApp.java