FIP-X: Add location type as a valid Embed type. #197
Replies: 5 comments 17 replies
-
Generally supportive! A couple thoughts:
I still think one decimal point of precision isn't precise enough. For all the points you bring up in the "Why allow multiple locations in a single Cast?" section:
These are all not really possible with an 11km margin of error |
Beta Was this translation helpful? Give feedback.
-
I'm a fan of this proposal, wanted to add some feedback:
the number of embeds is limited to 2 at the protocol level |
Beta Was this translation helpful? Give feedback.
-
@christopherwxyz do you think there's value in supporting the full geo uri spec? We do need latitude and longitude of course, but I'm trying to understand whether all the other parameters supported by the geo uri spec are valuable. If we support the full geo-uri spec, then hubs will need to perform some sort of validation on the uri data to make sure that it's reasonable and then parse out the lat, long data to make sure the precision is correct. Clients will also need to do the parsing. Trying to reason about whether using geo uri is worth this overhead or whether we should (1) only support enough of the geo uri spec to specify latitude and longitude (2) pursue a different representation (still a string) but not geo uri. We did also think about using JSON or protobuf. The main issue with JSON is that it's not compact. Encoding lat/long directly in the proto is feasible. It doesn't save us space over the geo uri representation that contains just latitude and longitude and it does complicate the You did mention that geo URI is widely supported. If that's the case, some of these concerns are moot. Are there good libraries for parsing geo URIs? Alternatively are there location apis (e.g. google places, mapbox) that directly accept geo URI? |
Beta Was this translation helpful? Give feedback.
-
If we modify the protocol to add a new embed_type, I suggest we revisit #171 (External Data FIP). The original version of the FIP had a new embed type (let's call it extended data), that linked to a json, that could be used for any type of data, from long casts, to location data, to events, reviews, etc. I believe that instead of adding one new embed type every time we need it, we should go for a more generic solution. |
Beta Was this translation helpful? Give feedback.
-
@aditiharini, since the image upload is not working on Warpcast, i wanted to share a mockup of implementing and not implementing label as a parameter for the geo uri. i am fine with dropping label from this FIP if it means we move faster, but would like to see an improvement to implement. the main benefit to adding a label is that users and clients can give greater specificity over their place and location than just the coordinates.
|
Beta Was this translation helpful? Give feedback.
-
FIP-X: Add location type as a valid Embed type.
Abstract
This FIP proposes adding support for Geo URIs as an embed option for cast messages in the Farcaster protocol. This addition will allow users to attach one or more location data points to their casts, enabling rich location-based features across various clients.
Problem
Currently, the Farcaster protocol doesn't have a standardized way to include location information in cast messages. This limitation prevents the development of location-based features that could enhance user experience and interaction across different clients. Some potential use cases include:
While some clients (e.g. Warpcast, Checkin) have implemented location features at the client level, there's no protocol-level support for sharing this information in a way that all clients can process uniformly.
Specification
We propose extending the
Embed
message to include support for Geo URIs. This location data will be:Encoding
Location values will be encoded as Geo URIs, with latitude and longitude rounded to two decimal places, followed by an optional place label. For example, the Geo URI for Brooklyn (near Brooklyn Bridge Park) would be:
geo:40.70,-74.00;label=Brooklyn%20Bridge%20Park
This format includes:
The 2dp rounding provides an approximate precision of 1.1 kilometers, offering a good balance between usability and privacy.
Message Definitions
We'll update the existing messages to support Geo URIs:
Multiple Locations
A Cast can include multiple Geo URI embeds. This allows users to represent routes, areas, or multiple points of interest in a single Cast. Clients should be prepared to handle and display multiple locations appropriately.
Validation Rules
geo:latitude,longitude;label=place_name
A Cast may contain multiple Embed objects with Geo URIs
The total number of Embed objects (including all types) in a Cast should not exceed 2 to maintain existing expectations for Embed elements.
Rationale
Why use Geo URIs?
Geo URIs provide a standardized, concise, and documented format for representing geographic locations. They are easy to parse and can be used directly in many mapping applications and services.
Why round the latitude/longitude values to 2 decimal places?
Rounding to two decimal places provides a good balance between usability and privacy. It offers precision to about 1.1 kilometers, which is sufficient for most use cases while still protecting users from inadvertently sharing their exact location.
Why allow multiple locations in a single Cast?
Allowing multiple locations in a Cast enables users to share more complex spatial information, such as:
This flexibility allows for richer location-based content and features in Farcaster clients.
Backwards Compatibility
This change is backwards compatible. Older clients that don't support the new Geo URI embed type can simply ignore it, continuing to process
url
andcast_id
embeds as before.Reference Implementation
Here's a TypeScript implementation for creating and processing Geo URI embeds:
Security Considerations
Copyright
Copyright and related rights waived via CC0.
Credits
@zachterrell57 @vrypan, @aditiharini @goksu for #196
Beta Was this translation helpful? Give feedback.
All reactions